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

Unified Diff: tools/create_tarball.py

Issue 197313010: Initial refactorings to support archiving the src and debian package builds. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 months 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 | « tools/create_debian_packages.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/create_tarball.py
===================================================================
--- tools/create_tarball.py (revision 33696)
+++ tools/create_tarball.py (working copy)
@@ -32,7 +32,6 @@
HOST_OS = utils.GuessOS()
DART_DIR = abspath(join(__file__, '..', '..'))
-
# Flags.
verbose = False
@@ -52,6 +51,10 @@
result.add_option("-v", "--verbose",
help='Verbose output.',
default=False, action="store_true")
+ result.add_option("--tar_filename",
+ default=None,
+ help="The output file.")
+
return result
def Filter(tar_info):
@@ -103,23 +106,18 @@
f.write(svn_revision)
-def CreateTarball():
+def CreateTarball(tarfilename):
global ignoredPaths # Used for adding the output directory.
# Generate the name of the tarfile
version = utils.GetVersion()
global versiondir
versiondir = 'dart-%s' % version
- tarname = '%s.tar.gz' % versiondir
debian_dir = 'tools/linux_dist_support/debian'
- # Create the tar file in the build directory.
- builddir = utils.GetBuildDir(HOST_OS, HOST_OS)
- tardir = join(DART_DIR, builddir)
# Don't include the build directory in the tarball (ignored paths
# are relative to DART_DIR).
+ builddir = utils.GetBuildDir(HOST_OS, HOST_OS)
ignoredPaths.append(builddir)
- if not exists(tardir):
- makedirs(tardir)
- tarfilename = join(tardir, tarname)
+
print 'Creating tarball: %s' % tarfilename
with tarfile.open(tarfilename, mode='w:gz') as tar:
for f in listdir(DART_DIR):
@@ -157,7 +155,10 @@
global verbose
verbose = True
- CreateTarball()
+ if not options.tar_filename:
+ raise Exception('Please specify an output filename')
+ CreateTarball(options.tar_filename)
+
if __name__ == '__main__':
sys.exit(Main())
« no previous file with comments | « tools/create_debian_packages.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698