diff options
author | Brian Orr <brianorr@google.com> | 2021-05-10 11:40:02 -0700 |
---|---|---|
committer | Rob Seymour <rseymour@google.com> | 2021-05-10 23:51:25 +0000 |
commit | 73ea169803de4936f7361cc682b7622e04100172 (patch) | |
tree | 2c8936aa12f0f62606b79c8079caae17ce330d2c /envsetup.sh | |
parent | 71ef414209eb90ac20c0d1d0a1619c23eb3d994d (diff) | |
parent | 046fca5dbd1159a63602a7cbe346707e430a32d7 (diff) |
Merge SP1A.210510.001
Change-Id: Ife6652cf718c7d08b65f148c2e69b8e39bcba050
Diffstat (limited to 'envsetup.sh')
-rw-r--r-- | envsetup.sh | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/envsetup.sh b/envsetup.sh index e575d25b2f..83163cd20d 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -1459,13 +1459,17 @@ function refreshmod() { # Verifies that module-info.txt exists, creating it if it doesn't. function verifymodinfo() { if [ ! "$ANDROID_PRODUCT_OUT" ]; then - echo "No ANDROID_PRODUCT_OUT. Try running 'lunch' first." >&2 + if [ "$QUIET_VERIFYMODINFO" != "true" ] ; then + echo "No ANDROID_PRODUCT_OUT. Try running 'lunch' first." >&2 + fi return 1 fi if [ ! -f "$ANDROID_PRODUCT_OUT/module-info.json" ]; then - echo "Could not find module-info.json. It will only be built once, and it can be updated with 'refreshmod'" >&2 - refreshmod || return 1 + if [ "$QUIET_VERIFYMODINFO" != "true" ] ; then + echo "Could not find module-info.json. It will only be built once, and it can be updated with 'refreshmod'" >&2 + fi + return 1 fi } @@ -1474,7 +1478,7 @@ function verifymodinfo() { function allmod() { verifymodinfo || return 1 - python -c "import json; print('\n'.join(sorted(json.load(open('$ANDROID_PRODUCT_OUT/module-info.json')).keys())))" + python3 -c "import json; print('\n'.join(sorted(json.load(open('$ANDROID_PRODUCT_OUT/module-info.json')).keys())))" } # Get the path of a specific module in the android tree, as cached in module-info.json. @@ -1488,7 +1492,7 @@ function pathmod() { verifymodinfo || return 1 - local relpath=$(python -c "import json, os + local relpath=$(python3 -c "import json, os module = '$1' module_info = json.load(open('$ANDROID_PRODUCT_OUT/module-info.json')) if module not in module_info: @@ -1514,7 +1518,7 @@ function dirmods() { verifymodinfo || return 1 - python -c "import json, os + python3 -c "import json, os dir = '$1' while dir.endswith('/'): dir = dir[:-1] @@ -1559,7 +1563,7 @@ function outmod() { verifymodinfo || return 1 local relpath - relpath=$(python -c "import json, os + relpath=$(python3 -c "import json, os module = '$1' module_info = json.load(open('$ANDROID_PRODUCT_OUT/module-info.json')) if module not in module_info: @@ -1603,7 +1607,7 @@ function installmod() { function _complete_android_module_names() { local word=${COMP_WORDS[COMP_CWORD]} - COMPREPLY=( $(allmod | grep -E "^$word") ) + COMPREPLY=( $(QUIET_VERIFYMODINFO=true allmod | grep -E "^$word") ) } # Print colored exit condition |