extract_utils: Split optional args with semicolon instead of colon

* Fix optional flags like PRESIGNED
  after I1f5a1abd6929e4a7e0ccd6370d3a3dd986f94fed

Change-Id: I889f995d7f19b09908cfbaf7474442ce48bfabdb
This commit is contained in:
Michael Bestas 2018-01-25 21:05:36 +02:00
parent c982836ca6
commit 3f9b94cb67

View file

@ -123,13 +123,13 @@ function target_file() {
#
# target_args:
#
# $1: colon delimited list
# $1: semicolon delimited list
#
# Returns optional arguments (last value) for given target
#
function target_args() {
local LINE="$1"
local SPLIT=(${LINE//:/ })
local SPLIT=(${LINE//;/ })
local COUNT=${#SPLIT[@]}
if [ "$COUNT" -gt "1" ]; then
if [[ ! "${SPLIT[$COUNT-1]}" =~ .*/.* ]]; then
@ -266,7 +266,7 @@ function write_packages() {
local SRC=
for P in "${FILELIST[@]}"; do
FILE=$(target_file "$P")
FILE=$(echo $(target_file "$P") | sed 's/\;.*//')
ARGS=$(target_args "$P")
BASENAME=$(basename "$FILE")
@ -305,13 +305,11 @@ function write_packages() {
printf 'LOCAL_MULTILIB := %s\n' "$EXTRA"
fi
elif [ "$CLASS" = "APPS" ]; then
if [ -z "$ARGS" ]; then
if [ "$EXTRA" = "priv-app" ]; then
SRC="$SRC/priv-app"
else
SRC="$SRC/app"
fi
fi
printf 'LOCAL_SRC_FILES := %s/%s\n' "$SRC" "$FILE"
local CERT=platform
if [ ! -z "$ARGS" ]; then
@ -939,7 +937,7 @@ function extract() {
local FROM=$(target_file "${FILELIST[$i-1]}")
local ARGS=$(target_args "${FILELIST[$i-1]}")
local SPLIT=(${FILELIST[$i-1]//:/ })
local FILE="${SPLIT[0]#-}"
local FILE=$(echo "${SPLIT[0]#-}" | sed 's/\;.*//')
local OUTPUT_DIR="$OUTPUT_ROOT"
local TMP_DIR="$OUTPUT_TMP"
local TARGET=