diff options
Diffstat (limited to 'update.py')
-rwxr-xr-x | update.py | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -16,6 +16,7 @@ import filecmp import glob +import json import os import shutil import subprocess @@ -33,7 +34,15 @@ TORTURE_DIR = os.path.join(BASE_DIR, 'torture-s') def download_revision(force_latest): name = 'latest' if force_latest else 'lkgr' - return urllib2.urlopen(STORAGE_BASE + name).read().strip() + downloaded = urllib2.urlopen(STORAGE_BASE + name).read().strip() + # TODO: for now try opening as JSON, if that doesn't work then the content is + # just a hash. The waterfall is in the process of migrating to JSON. + info = None + try: + info = json.loads(downloaded) + except: + pass + return info['build'] if type(info) == dict else downloaded def write_revision(revision): @@ -102,7 +111,7 @@ def getargs(): import argparse parser = argparse.ArgumentParser( description='Update the repository dependencies.') - parser.add_argument('--force-latest', type=bool, default=False, + parser.add_argument('--force-latest', action='store_true', help='Sync to latest waterfall build, not lkgr') parser.add_argument('--override-hash', type=str, default=None, help='Sync to specific hash from waterfall build') |