Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(941)

Unified Diff: runtime/tools/create_archive.py

Issue 1534523002: Compress Observatory assets (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/vmservice_dartium.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/tools/create_archive.py
diff --git a/runtime/tools/create_archive.py b/runtime/tools/create_archive.py
index f2fe6c157dcf5d78e55af61d476520525a2f872e..7b0e99d7787d3911dda9589d65c4c1400e48fe02 100644
--- a/runtime/tools/create_archive.py
+++ b/runtime/tools/create_archive.py
@@ -14,8 +14,11 @@ from datetime import date
import tarfile
import tempfile
-def makeArchive(tar_path, client_root, files):
- tar = tarfile.open(tar_path, mode='w')
+def makeArchive(tar_path, client_root, compress, files):
+ mode_string = 'w'
+ if compress:
+ mode_string = 'w:gz'
+ tar = tarfile.open(tar_path, mode=mode_string)
for input_file_name in files:
# Chop off client_root.
archive_file_name = input_file_name[ len(client_root) : ]
@@ -98,6 +101,7 @@ def main(args):
parser.add_option("--name",
action="store", type="string",
help="name of tar archive symbol")
+ parser.add_option("--compress", action="store_true", default=False)
parser.add_option("--client_root",
action="store", type="string",
help="root directory client resources")
@@ -129,7 +133,10 @@ def main(args):
files.append(src_path)
# Write out archive.
- makeArchive(options.tar_output, options.client_root, files)
+ makeArchive(options.tar_output,
+ options.client_root,
+ options.compress,
+ files)
# Read it back in.
with open(options.tar_output, 'rb') as tar_file:
« no previous file with comments | « runtime/bin/vmservice_dartium.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698