Index: tools/get_archive.py |
=================================================================== |
--- tools/get_archive.py (revision 10541) |
+++ tools/get_archive.py (working copy) |
@@ -34,22 +34,22 @@ |
DRT_LATEST_PATTERN = ( |
'gs://dartium-archive/latest/drt-%(osname)s-inc-*.zip') |
DRT_PERMANENT_PATTERN = ('gs://dartium-archive/drt-%(osname)s-inc/drt-' |
- '%(osname)s-inc-%(num)s.%(num)s.zip') |
+ '%(osname)s-inc-%(num1)s.%(num2)s.zip') |
DARTIUM_DIR = os.path.join('client', 'tests', 'dartium') |
DARTIUM_VERSION = os.path.join(DARTIUM_DIR, 'LAST_VERSION') |
DARTIUM_LATEST_PATTERN = ( |
'gs://dartium-archive/latest/dartium-%(osname)s-inc-*.zip') |
DARTIUM_PERMANENT_PATTERN = ('gs://dartium-archive/dartium-%(osname)s-inc/' |
- 'dartium-%(osname)s-inc-%(num)s.%(num)s.zip') |
+ 'dartium-%(osname)s-inc-%(num1)s.%(num2)s.zip') |
CHROMEDRIVER_DIR = os.path.join('tools', 'testing', 'dartium-chromedriver') |
CHROMEDRIVER_VERSION = os.path.join(CHROMEDRIVER_DIR, 'LAST_VERSION') |
CHROMEDRIVER_LATEST_PATTERN = ( |
'gs://dartium-archive/latest/chromedriver-%(osname)s-inc-*.zip') |
CHROMEDRIVER_PERMANENT_PATTERN = ('gs://dartium-archive/chromedriver-%(osname)s' |
- '-inc/chromedriver-%(osname)s-inc-%(num)s.' |
- '%(num)s.zip') |
+ '-inc/chromedriver-%(osname)s-inc-%(num1)s.' |
+ '%(num2)s.zip') |
SDK_DIR = os.path.join(utils.GetBuildRoot(utils.GuessOS(), 'release', 'ia32'), |
'dart-sdk') |
@@ -141,7 +141,26 @@ |
latest = output_lines[-1] |
if not revision_num: |
revision_num = latest[latest.rindex('-') + 1 : latest.index('.')] |
- latest = (permanent_prefix % { 'osname' : osname, 'num' : revision_num }) |
+ latest = (permanent_prefix[:permanent_prefix.rindex('/')] % { 'osname' : |
+ osname, 'num' : revision_num } + latest[latest.rindex('/'):]) |
vsm
2012/08/13 23:12:57
The 'num' doesn't appear the patterns above. Do y
Emily Fortuna
2012/08/13 23:16:42
Nope. Fixed!
|
+ else: |
+ latest = (permanent_prefix % { 'osname' : osname, 'num1' : revision_num, |
+ 'num2' : revision_num }) |
+ foundURL = False |
+ while not foundURL: |
+ # Test to ensure this URL exists because the dartium-archive builds can |
+ # have unusual numbering (a range of CL numbers) sometimes. |
+ result, out = gsutil('ls', permanent_prefix % {'osname' : osname, |
+ 'num1': '*', 'num2': revision_num }) |
+ if result == 0: |
+ # First try to find one with the the second number the same as the |
+ # requested number. |
+ latest = out.split()[0] |
+ foundURL = True |
+ else: |
+ # Now try to find one with a nearby CL num. |
+ revision_num = int(revision_num) - 1 |
+ print latest |
vsm
2012/08/13 23:12:57
Debugging print you left in?
Emily Fortuna
2012/08/13 23:16:42
Yes, removed.
|
return latest |
get_from_gsutil(name, directory, version_file, latest_pattern, osdict, |