diff --git a/build/tools/extract_utils.sh b/build/tools/extract_utils.sh index 6420adba..aed50666 100644 --- a/build/tools/extract_utils.sh +++ b/build/tools/extract_utils.sh @@ -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,12 +305,10 @@ 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 + if [ "$EXTRA" = "priv-app" ]; then + SRC="$SRC/priv-app" + else + SRC="$SRC/app" fi printf 'LOCAL_SRC_FILES := %s/%s\n' "$SRC" "$FILE" local CERT=platform @@ -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=