summaryrefslogtreecommitdiffstats
path: root/tools/export_tarball
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-29 22:06:57 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-29 22:06:57 +0000
commitb9c44f931b7f349dfe0df49e04520d66595c743b (patch)
tree1c2f62622a6d352b3837074e2b12a0fbc1e5f5c5 /tools/export_tarball
parente66e0f9728e6037dd20a920dd1d6ce55a95c6efe (diff)
downloadchromium_src-b9c44f931b7f349dfe0df49e04520d66595c743b.zip
chromium_src-b9c44f931b7f349dfe0df49e04520d66595c743b.tar.gz
chromium_src-b9c44f931b7f349dfe0df49e04520d66595c743b.tar.bz2
Linux: add --xz option to export_tarball.py script.
Using xz instead of bzip2 can save us 20-30 MB, which for a ~170 MB tarball is about 12% savings. BUG=none Review URL: https://codereview.chromium.org/11280161 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170251 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/export_tarball')
-rwxr-xr-xtools/export_tarball/export_tarball.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/tools/export_tarball/export_tarball.py b/tools/export_tarball/export_tarball.py
index 9ec5fe5..8a9cbb0 100755
--- a/tools/export_tarball/export_tarball.py
+++ b/tools/export_tarball/export_tarball.py
@@ -101,6 +101,7 @@ def main(argv):
parser.add_option("--remove-nonessential-files",
dest="remove_nonessential_files",
action="store_true", default=False)
+ parser.add_option("--xz", action="store_true")
options, args = parser.parse_args(argv)
@@ -119,16 +120,28 @@ def main(argv):
print 'Could not run build/util/lastchange.py to update LASTCHANGE.'
return 1
- output_fullname = args[0] + '.tar.bz2'
+ if options.xz:
+ output_fullname = args[0] + '.tar'
+ else:
+ output_fullname = args[0] + '.tar.bz2'
+
output_basename = os.path.basename(args[0])
- archive = MyTarFile.open(output_fullname, 'w:bz2')
+ if options.xz:
+ archive = MyTarFile.open(output_fullname, 'w')
+ else:
+ archive = MyTarFile.open(output_fullname, 'w:bz2')
archive.set_remove_nonessential_files(options.remove_nonessential_files)
try:
archive.add(GetSourceDirectory(), arcname=output_basename)
finally:
archive.close()
+ if options.xz:
+ if subprocess.call(['xz', '-9', output_fullname]) != 0:
+ print 'xz -9 failed!'
+ return 1
+
return 0