diff options
author | LuK1337 <priv.luk@gmail.com> | 2021-08-23 18:18:57 +0200 |
---|---|---|
committer | Ćukasz Patron <priv.luk@gmail.com> | 2021-08-23 18:21:58 +0200 |
commit | 72d5bdfb73ca80089af4f243c252ecde210d357f (patch) | |
tree | 42b479512652cf2e78f3c28f4cc9659adcfcae98 | |
parent | 3749ce5b2983b72bab996b4c046680b450f06b25 (diff) |
fixup! extract_utils: Add support for overriding packages
This unifies arguments parsing + fixes case where OVERRIDES=pkg would
generate .bp without `certificate: "platform"`.
Change-Id: I0036e0e942ff9272da10f14aeb7235f0b6b92b00
-rw-r--r-- | extract_utils.sh | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/extract_utils.sh b/extract_utils.sh index 94c717d..786bcf7 100644 --- a/extract_utils.sh +++ b/extract_utils.sh @@ -425,20 +425,22 @@ function write_blueprint_packages() { fi printf '\tapk: "%s/%s",\n' "$SRC" "$FILE" ARGS=(${ARGS//;/ }) - if [ -z "$ARGS" ]; then + USE_PLATFORM_CERTIFICATE="true" + for ARG in "${ARGS[@]}"; do + if [ "$ARG" = "PRESIGNED" ]; then + USE_PLATFORM_CERTIFICATE="false" + printf '\tpresigned: true,\n' + elif [[ "$ARG" =~ "OVERRIDES" ]]; then + OVERRIDEPKG=${ARG#*=} + OVERRIDEPKG=${OVERRIDEPKG//,/ } + printf '\toverrides: ["%s"],\n' "$OVERRIDEPKG" + elif [ ! -z "$ARG" ]; then + USE_PLATFORM_CERTIFICATE="false" + printf '\tcertificate: "%s",\n' "$ARG" + fi + done + if [ "$USE_PLATFORM_CERTIFICATE" = "true" ]; then printf '\tcertificate: "platform",\n' - else - for ARG in "${ARGS[@]}"; do - if [ "$ARG" = "PRESIGNED" ]; then - printf '\tpresigned: true,\n' - elif [[ "$ARG" =~ "OVERRIDES" ]]; then - OVERRIDEPKG=${ARG#*=} - OVERRIDEPKG=${OVERRIDEPKG//,/ } - printf '\toverrides: ["%s"],\n' "$OVERRIDEPKG" - elif [ ! -z "$ARG" ]; then - printf '\tcertificate: "%s",\n' "$ARG" - fi - done fi elif [ "$CLASS" = "JAVA_LIBRARIES" ]; then printf 'dex_import {\n' |