diff options
author | Haibo Huang <hhb@google.com> | 2019-02-01 12:49:39 -0800 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-02-01 12:49:39 -0800 |
commit | 0e67f8e5450c7e98e47b4039f7746a67d03b5d33 (patch) | |
tree | d0dcec75e47ce28e36120af83c7ce3e840fa08c7 | |
parent | 605d98fac8a978bdbb793f964c1dd9b3b373f16a (diff) | |
parent | 99506faa1aae363fceace4a5a645bcd44ba57f96 (diff) | |
download | external_updater-0e67f8e5450c7e98e47b4039f7746a67d03b5d33.tar.gz |
[Updater] Check and update all supported projects am: 1c7284ea18
am: 99506faa1a
Change-Id: I129926c7e3db64ab64dc0a1d601c00876f878021
-rw-r--r-- | external_updater.py | 4 | ||||
-rw-r--r-- | 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(): |