diff options
author | Jeff Sharkey <jsharkey@android.com> | 2021-05-25 10:09:03 -0600 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2021-05-25 11:26:13 -0600 |
commit | abe16dffa5e40c1939be190dc2a6140dcdfd5e46 (patch) | |
tree | 02ce6f0db2b7992bfd0bf6e9c1a58702f0ebe6e2 | |
parent | 0a892c8f6625877ed7d2f15c979eeca65f9f91f7 (diff) | |
download | sdk-abe16dffa5e40c1939be190dc2a6140dcdfd5e46.tar.gz |
Add update_prebuilts.py support for BeyondCorp.
It needs to use a different binary and command line options when
fetching artifacts from the build server.
Bug: 189224267
Test: manual
Change-Id: I5130bb16e8adefe0e3af4d2d194cad7efdcdc865
-rwxr-xr-x | update_prebuilts/update_prebuilts.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/update_prebuilts/update_prebuilts.py b/update_prebuilts/update_prebuilts.py index e17f1fa01..da1821f01 100755 --- a/update_prebuilts/update_prebuilts.py +++ b/update_prebuilts/update_prebuilts.py @@ -24,6 +24,7 @@ git_dir = os.getcwd() # See go/fetch_artifact for details on this script. FETCH_ARTIFACT = '/google/data/ro/projects/android/fetch_artifact' +FETCH_ARTIFACT_BEYOND_CORP = '/usr/bin/fetch_artifact' maven_to_make = { # AndroidX @@ -412,12 +413,17 @@ def process_aar(artifact_file, target_dir): def fetch_artifact(target, build_id, artifact_path): + global args download_to = os.path.join('.', os.path.dirname(artifact_path)) print('Fetching %s from %s ...' % (artifact_path, target)) if not os.path.exists(download_to): os.makedirs(download_to) - fetch_cmd = [FETCH_ARTIFACT, '--bid', str(build_id), '--target', target, artifact_path, - download_to] + if args.beyond_corp: + fetch_cmd = [FETCH_ARTIFACT_BEYOND_CORP, '--use_oauth2', + '--bid', str(build_id), '--target', target, artifact_path, download_to] + else: + fetch_cmd = [FETCH_ARTIFACT, + '--bid', str(build_id), '--target', target, artifact_path, download_to] print("Running: " + ' '.join(fetch_cmd)) try: subprocess.check_output(fetch_cmd, stderr=subprocess.STDOUT) @@ -714,6 +720,9 @@ parser.add_argument( parser.add_argument( '--commit-first', action="store_true", help='If specified, then if uncommited changes exist, commit before continuing') +parser.add_argument( + '--beyond-corp', action="store_true", + help='If specified, then fetch artifacts with tooling that works on BeyondCorp devices') args = parser.parse_args() args.file = True if not args.source: |