| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """ | 6 """ |
| 7 This tool creates a tarball with all the sources, but without .svn directories. | 7 This tool creates a tarball with all the sources, but without .svn directories. |
| 8 | 8 |
| 9 It can also remove files which are not strictly required for build, so that | 9 It can also remove files which are not strictly required for build, so that |
| 10 the resulting tarball can be reasonably small (last time it was ~110 MB). | 10 the resulting tarball can be reasonably small (last time it was ~110 MB). |
| 11 | 11 |
| 12 Example usage: | 12 Example usage: |
| 13 | 13 |
| 14 export_tarball.py /foo/bar | 14 export_tarball.py /foo/bar |
| 15 | 15 |
| 16 The above will create file /foo/bar.tar.bz2. | 16 The above will create file /foo/bar.tar.bz2. |
| 17 """ | 17 """ |
| 18 | 18 |
| 19 import optparse | 19 import optparse |
| 20 import os | 20 import os |
| 21 import sys | 21 import sys |
| 22 import tarfile | 22 import tarfile |
| 23 | 23 |
| 24 NONESSENTIAL_DIRS = ( | 24 NONESSENTIAL_DIRS = ( |
| 25 'chrome/test/data', | 25 'chrome/test/data', |
| 26 'chrome/tools/test/reference_build', | 26 'chrome/tools/test/reference_build', |
| 27 'gears/binaries', | 27 'gears/binaries', |
| 28 'native_client/tests', |
| 28 'net/data/cache_tests', | 29 'net/data/cache_tests', |
| 30 'src/chrome/test/data', |
| 29 'o3d/documentation', | 31 'o3d/documentation', |
| 30 'o3d/samples', | 32 'o3d/samples', |
| 31 'third_party/lighttpd', | 33 'third_party/lighttpd', |
| 32 'third_party/WebKit/LayoutTests', | 34 'third_party/WebKit/LayoutTests', |
| 33 'webkit/data/layout_tests', | 35 'webkit/data/layout_tests', |
| 34 'webkit/tools/test/reference_build', | 36 'webkit/tools/test/reference_build', |
| 35 ) | 37 ) |
| 36 | 38 |
| 37 def GetSourceDirectory(): | 39 def GetSourceDirectory(): |
| 38 return os.path.realpath( | 40 return os.path.realpath( |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 archive.set_remove_nonessential_files(options.remove_nonessential_files) | 83 archive.set_remove_nonessential_files(options.remove_nonessential_files) |
| 82 try: | 84 try: |
| 83 archive.add(GetSourceDirectory(), arcname=output_basename) | 85 archive.add(GetSourceDirectory(), arcname=output_basename) |
| 84 finally: | 86 finally: |
| 85 archive.close() | 87 archive.close() |
| 86 | 88 |
| 87 return 0 | 89 return 0 |
| 88 | 90 |
| 89 if __name__ == "__main__": | 91 if __name__ == "__main__": |
| 90 sys.exit(main(sys.argv[1:])) | 92 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |