diff options
author | Zhizhou Yang <zhizhouy@google.com> | 2017-07-22 01:11:35 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-07-22 01:11:35 +0000 |
commit | ddfea1f7e75062a350bd5a9418562e3b5af5b6e9 (patch) | |
tree | bf139ee25415cecde142e95791edba3803b2452a /setup_chromeos.py | |
parent | 3690e025de8daaed03c4acb02d2b054e5c4c0dd5 (diff) | |
parent | 6c551e0d526de7de9d86516614d645cba6f975a6 (diff) | |
download | toolchain-utils-o-mr1-iot-preview-6.tar.gz |
Merge branch 'aosp/mirror-chromium-master' into update_utils am: 4307f4735e am: 18caef1eddandroid-o-mr1-iot-preview-6o-mr1-iot-preview-6
am: 6c551e0d52
Change-Id: I44720cd3cd736bb61f583fb20df1c25ac9323ae0
Diffstat (limited to 'setup_chromeos.py')
-rwxr-xr-x | setup_chromeos.py | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/setup_chromeos.py b/setup_chromeos.py index b6f9f4df..0b51d830 100755 --- a/setup_chromeos.py +++ b/setup_chromeos.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2 +#!/usr/bin/env python2 # # Copyright 2010 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be @@ -99,13 +99,15 @@ def TimeToCommonVersion(timestamp): def Main(argv): """Checkout the ChromeOS source.""" parser = argparse.ArgumentParser() - parser.add_argument('--dir', - dest='directory', - help='Target directory for ChromeOS installation.') - parser.add_argument('--version', - dest='version', - default='latest_lkgm', - help="""ChromeOS version. Can be: + parser.add_argument( + '--dir', + dest='directory', + help='Target directory for ChromeOS installation.') + parser.add_argument( + '--version', + dest='version', + default='latest_lkgm', + help="""ChromeOS version. Can be: (1) A release version in the format: 'X.X.X.X' (2) 'top' for top of trunk (3) 'latest_lkgm' for the latest lkgm version @@ -113,31 +115,32 @@ def Main(argv): (5) 'latest_common' for the latest team common stable version (6) 'common' for the team common stable version before timestamp Default is 'latest_lkgm'.""") - parser.add_argument('--timestamp', - dest='timestamp', - default=None, - help='Timestamps in epoch format. It will check out the' - 'latest LKGM or the latest COMMON version of ChromeOS' - ' before the timestamp. Use in combination with' - ' --version=latest or --version=common. Use ' - '"date -d <date string> +%s" to find epoch time') - parser.add_argument('--minilayout', - dest='minilayout', - default=False, - action='store_true', - help='Whether to checkout the minilayout (smaller ' - 'checkout).') - parser.add_argument('--jobs', - '-j', - dest='jobs', - help='Number of repo sync threads to use.') - parser.add_argument('--public', - '-p', - dest='public', - default=False, - action='store_true', - help='Use the public checkout instead of the private ' - 'one.') + parser.add_argument( + '--timestamp', + dest='timestamp', + default=None, + help='Timestamps in epoch format. It will check out the' + 'latest LKGM or the latest COMMON version of ChromeOS' + ' before the timestamp. Use in combination with' + ' --version=latest or --version=common. Use ' + '"date -d <date string> +%s" to find epoch time') + parser.add_argument( + '--minilayout', + dest='minilayout', + default=False, + action='store_true', + help='Whether to checkout the minilayout (smaller ' + 'checkout).') + parser.add_argument( + '--jobs', '-j', dest='jobs', help='Number of repo sync threads to use.') + parser.add_argument( + '--public', + '-p', + dest='public', + default=False, + action='store_true', + help='Use the public checkout instead of the private ' + 'one.') options = parser.parse_args(argv) @@ -167,20 +170,16 @@ Default is 'latest_lkgm'.""") versions_repo = ('https://chromium.googlesource.com/' 'chromiumos/manifest-versions.git') else: - manifest_repo = ( - 'https://chrome-internal.googlesource.com/chromeos/' - 'manifest-internal.git' - ) - versions_repo = ( - 'https://chrome-internal.googlesource.com/chromeos/' - 'manifest-versions.git' - ) + manifest_repo = ('https://chrome-internal.googlesource.com/chromeos/' + 'manifest-internal.git') + versions_repo = ('https://chrome-internal.googlesource.com/chromeos/' + 'manifest-versions.git') if version == 'top': init = 'repo init -u %s' % manifest_repo elif version == 'latest_lkgm': manifests = manifest_versions.ManifestVersions() - version = manifests.TimeToVersion(time.mktime(time.gmtime())) + version = manifests.TimeToVersionChromeOS(time.mktime(time.gmtime())) version, manifest = version.split('.', 1) logger.GetLogger().LogOutput('found version %s.%s for latest LKGM' % (version, manifest)) @@ -194,8 +193,9 @@ Default is 'latest_lkgm'.""") manifests = manifest_versions.ManifestVersions() version = manifests.TimeToVersion(timestamp) version, manifest = version.split('.', 1) - logger.GetLogger().LogOutput('found version %s.%s for LKGM at timestamp %s' - % (version, manifest, timestamp)) + logger.GetLogger().LogOutput( + 'found version %s.%s for LKGM at timestamp %s' % (version, manifest, + timestamp)) init = ('repo init -u %s -m paladin/buildspecs/%s/%s.xml' % (versions_repo, version, manifest)) del manifests |