| OLD | NEW | 
|---|
| 1 #!/usr/bin/python | 1 #!/usr/bin/python | 
| 2 | 2 | 
| 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be | 
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. | 
| 6 | 6 | 
| 7 import glob | 7 import glob | 
| 8 import optparse | 8 import optparse | 
| 9 import os | 9 import os | 
| 10 import shutil | 10 import shutil | 
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 123   if not target: | 123   if not target: | 
| 124     return None | 124     return None | 
| 125 | 125 | 
| 126   stageDir = target | 126   stageDir = target | 
| 127   zipFile = stageDir + '.zip' | 127   zipFile = stageDir + '.zip' | 
| 128 | 128 | 
| 129   # Cleanup old files. | 129   # Cleanup old files. | 
| 130   if os.path.exists(stageDir): | 130   if os.path.exists(stageDir): | 
| 131     shutil.rmtree(stageDir) | 131     shutil.rmtree(stageDir) | 
| 132   os.mkdir(stageDir) | 132   os.mkdir(stageDir) | 
| 133   oldFiles = glob.glob(target.split('-')[0] + '*.zip') | 133   revision = target.split('-')[-1] | 
|  | 134   oldFiles = glob.glob(target.replace(revision, '*.zip') | 
| 134   for oldFile in oldFiles: | 135   for oldFile in oldFiles: | 
| 135     os.remove(oldFile) | 136     os.remove(oldFile) | 
| 136 | 137 | 
| 137   GenerateVersionFile() | 138   GenerateVersionFile() | 
| 138   GenerateZipFile(zipFile, stageDir, fileList) | 139   GenerateZipFile(zipFile, stageDir, fileList) | 
| 139   print 'last change: %s' % (zipFile) | 140   print 'last change: %s' % (zipFile) | 
| 140 | 141 | 
| 141   # Clean up. Buildbot disk space is limited. | 142   # Clean up. Buildbot disk space is limited. | 
| 142   shutil.rmtree(stageDir) | 143   shutil.rmtree(stageDir) | 
| 143 | 144 | 
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 194                     action='store', type='string', | 195                     action='store', type='string', | 
| 195                     help='(Release|Debug)') | 196                     help='(Release|Debug)') | 
| 196   (options, args) = parser.parse_args() | 197   (options, args) = parser.parse_args() | 
| 197   Archive(srcpath, options.mode, options.dartium, options.contentshell, | 198   Archive(srcpath, options.mode, options.dartium, options.contentshell, | 
| 198           options.chromedriver) | 199           options.chromedriver) | 
| 199   return 0 | 200   return 0 | 
| 200 | 201 | 
| 201 | 202 | 
| 202 if __name__ == '__main__': | 203 if __name__ == '__main__': | 
| 203   sys.exit(main()) | 204   sys.exit(main()) | 
| OLD | NEW | 
|---|