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

Side by Side Diff: tools/export_tarball/export_tarball.py

Issue 14973005: Generate and use LASTCHANGE for blink (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « build/util/lastchange.py ('k') | webkit/build/webkit_version.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 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).
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 127
128 if len(args) != 1: 128 if len(args) != 1:
129 print 'You must provide only one argument: output file name' 129 print 'You must provide only one argument: output file name'
130 print '(without .tar.xz extension).' 130 print '(without .tar.xz extension).'
131 return 1 131 return 1
132 132
133 if not os.path.exists(GetSourceDirectory()): 133 if not os.path.exists(GetSourceDirectory()):
134 print 'Cannot find the src directory ' + GetSourceDirectory() 134 print 'Cannot find the src directory ' + GetSourceDirectory()
135 return 1 135 return 1
136 136
137 # This command is from src/DEPS; please keep them in sync. 137 # These two commands are from src/DEPS; please keep them in sync.
138 if subprocess.call(['python', 'build/util/lastchange.py', '-o', 138 if subprocess.call(['python', 'build/util/lastchange.py', '-o',
139 'build/util/LASTCHANGE'], cwd=GetSourceDirectory()) != 0: 139 'build/util/LASTCHANGE'], cwd=GetSourceDirectory()) != 0:
140 print 'Could not run build/util/lastchange.py to update LASTCHANGE.' 140 print 'Could not run build/util/lastchange.py to update LASTCHANGE.'
141 return 1 141 return 1
142 if subprocess.call(['python', 'build/util/lastchange.py', '-s',
143 'src/third_party/WebKit', '-o',
Paweł Hajdan Jr. 2013/06/14 20:44:00 Note: this broke the script (could be easily detec
144 'src/build/util/LASTCHANGE.blink'],
145 cwd=GetSourceDirectory()) != 0:
146 print 'Could not run build/util/lastchange.py to update LASTCHANGE.blink.'
147 return 1
142 148
143 output_fullname = args[0] + '.tar' 149 output_fullname = args[0] + '.tar'
144 output_basename = options.basename or os.path.basename(args[0]) 150 output_basename = options.basename or os.path.basename(args[0])
145 151
146 archive = MyTarFile.open(output_fullname, 'w') 152 archive = MyTarFile.open(output_fullname, 'w')
147 archive.set_remove_nonessential_files(options.remove_nonessential_files) 153 archive.set_remove_nonessential_files(options.remove_nonessential_files)
148 try: 154 try:
149 if options.test_data: 155 if options.test_data:
150 for directory in TESTDIRS: 156 for directory in TESTDIRS:
151 archive.add(os.path.join(GetSourceDirectory(), directory), 157 archive.add(os.path.join(GetSourceDirectory(), directory),
152 arcname=os.path.join(output_basename, directory)) 158 arcname=os.path.join(output_basename, directory))
153 else: 159 else:
154 archive.add(GetSourceDirectory(), arcname=output_basename) 160 archive.add(GetSourceDirectory(), arcname=output_basename)
155 finally: 161 finally:
156 archive.close() 162 archive.close()
157 163
158 if subprocess.call(['xz', '-9', output_fullname]) != 0: 164 if subprocess.call(['xz', '-9', output_fullname]) != 0:
159 print 'xz -9 failed!' 165 print 'xz -9 failed!'
160 return 1 166 return 1
161 167
162 return 0 168 return 0
163 169
164 170
165 if __name__ == "__main__": 171 if __name__ == "__main__":
166 sys.exit(main(sys.argv[1:])) 172 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « build/util/lastchange.py ('k') | webkit/build/webkit_version.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698