summaryrefslogtreecommitdiff
path: root/extract_utils.sh
diff options
context:
space:
mode:
authorLuK1337 <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
commit72d5bdfb73ca80089af4f243c252ecde210d357f (patch)
tree42b479512652cf2e78f3c28f4cc9659adcfcae98 /extract_utils.sh
parent3749ce5b2983b72bab996b4c046680b450f06b25 (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
Diffstat (limited to 'extract_utils.sh')
-rw-r--r--extract_utils.sh28
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'