diff options
-rwxr-xr-x | update.py | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -32,19 +32,20 @@ def write_revision(revision): f.write(revision) -def run(force_latest, override_hash): +def run(force_latest, override_build): subprocess.check_call(['git', 'submodule', 'sync', '--quiet']) subprocess.check_call(['git', 'submodule', 'init', '--quiet']) subprocess.check_call(['git', 'submodule', 'update', '--quiet']) subprocess.check_call(['git', 'submodule', 'foreach', 'git', 'pull', 'origin', 'master', '--quiet']) updates = 0 - revision = (override_hash if override_hash else + revision = (override_build if override_build else scripts.storage.download_revision(force_latest=force_latest)) downloaded = scripts.storage.download_tar(TORTURE_TAR, BASE_DIR, revision) updates += scripts.support.untar(downloaded, BASE_DIR) - if updates: - # Only update revision if the files it downloaded are different. + if updates or override_build: + # Only update revision if the files it downloaded are different, or if + # overriding the build ID. print 'Updating revision to', revision write_revision(revision) @@ -55,12 +56,12 @@ def getargs(): description='Update the repository dependencies.') 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') + parser.add_argument('--override-build', type=str, default=None, + help='Sync to specific build ID from waterfall build') return parser.parse_args() if __name__ == '__main__': args = getargs() sys.exit(run(force_latest=args.force_latest, - override_hash=args.override_hash)) + override_build=args.override_build)) |