From 1c7284ea18e830954664866cd56e1469337a8a6c Mon Sep 17 00:00:00 2001 From: Haibo Huang <hhb@google.com> Date: Fri, 1 Feb 2019 11:34:21 -0800 Subject: [PATCH] [Updater] Check and update all supported projects Test: local run Change-Id: I10b5f67144a9ec9511c8edfb609e20d0a7173647 --- external_updater.py | 4 ++-- notifier.py | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/external_updater.py b/external_updater.py index 65a8964..c524c0b 100644 --- a/external_updater.py +++ b/external_updater.py @@ -136,7 +136,7 @@ def _check_some(paths, delay): def _check_all(delay): results = {} - for path, dirs, files in os.walk(args.path): + for path, dirs, files in os.walk(fileutils.EXTERNAL_PATH): dirs.sort(key=lambda d: d.lower()) if fileutils.METADATA_FILENAME in files: # Skip sub directories. @@ -226,7 +226,7 @@ def parse_args(): '--json_output', help='Path of a json file to write result to.') check_parser.add_argument( - '--all', + '--all', action='store_true', help='If set, check updates for all supported projects.') check_parser.add_argument( '--delay', default=0, type=int, diff --git a/notifier.py b/notifier.py index 1e2c7cd..f82c5de 100644 --- a/notifier.py +++ b/notifier.py @@ -50,6 +50,9 @@ def parse_args(): parser.add_argument( 'paths', nargs='*', help='Paths of the project.') + parser.add_argument( + '--all', action='store_true', + help='Checks all projects.') return parser.parse_args() @@ -155,11 +158,15 @@ def _upgrade(proj): def _check_updates(args): - subprocess.run(['out/soong/host/linux-x86/bin/external_updater', - 'check', - '--json_output', RESULT_FILE_PATH, - '--delay', '0'] + args.paths, - cwd=os.environ['ANDROID_BUILD_TOP']) + params = ['out/soong/host/linux-x86/bin/external_updater', + 'check', '--json_output', RESULT_FILE_PATH, + '--delay', '0'] + if args.all: + params.append('--all') + else: + params += args.paths + + subprocess.run(params, cwd=os.environ['ANDROID_BUILD_TOP']) def main(): -- GitLab