#!/usr/bin/python
# Copyright 2010, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
#     * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
#     * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

"""Assemble the final installer for each platform.

At this time this is just a tarball.
"""

import os
import sys
import tarfile


def main(argv):
  tar = tarfile.open('sdk.tbz2', 'w:bz2')
  for root, _, files in os.walk('src', topdown=False):
    for name in files:
      tar.add(os.path.join(root, name))
  tar.close()


if __name__ == '__main__':
  main(sys.argv[1:])

@@ -1670,16 +1670,227 @@
 tarfile%0A
+import re%0A%0AEXCLUDE_DIRS = %5B'.svn', '.download', 'scons-out'%5D%0A%0A# Return True if %7Cfile%7C should be excluded from the tarball.%0Adef ExcludeFile(file):%0A  return file.startswith('.DS_Store') or re.search('%5E%5C._', file)%0A
 %0A%0Adef ma
@@ -1925,25 +1925,28 @@
 en('
+nacl-
 sdk.t
-bz2
+gz
 ', 'w:
-bz2
+gz
 ')%0A 
@@ -1956,17 +1956,20 @@
 r root, 
-_
+dirs
 , files 
@@ -1988,25 +1988,142 @@
 src'
-, topdown=False):
+):%0A    for excl in EXCLUDE_DIRS:%0A      if excl in dirs:%0A        dirs.remove(excl)%0A    files = %5Bf for f in files if not ExcludeFile(f)%5D
 %0A   

Add some logic to exclude certain directories and files from the tarball.