diff options
author | Vladimir Oltean <olteanv@gmail.com> | 2019-09-03 21:15:36 +0200 |
---|---|---|
committer | Isaac Chen <tingyi364@gmail.com> | 2019-11-05 13:23:23 +0100 |
commit | 05f6ed65f8491e2e43e5313ab0ed1d2cffba63db (patch) | |
tree | fdd21a8df932cc58b90c68450d0b52a3560ab049 | |
parent | 2e306cf191fa3613946242008003c7b66c21062e (diff) |
sdm660-common: Rework extract-files with --kang support
* Implementation from lineage vendor extract-files
Change-Id: I1170fcfa1ec237c9c0b322e9f268bdeb685b473a
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
-rwxr-xr-x | extract-files.sh | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/extract-files.sh b/extract-files.sh index d5c7409..7e175b9 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -33,20 +33,24 @@ if [ ! -f "$HELPER" ]; then fi . "$HELPER" -# default to not sanitizing the vendor folder before extraction -CLEAN_VENDOR=false +# Default to sanitizing the vendor folder before extraction +CLEAN_VENDOR=true -while [ "$1" != "" ]; do - case $1 in - -p | --path ) shift - SRC=$1 - ;; - -s | --section ) shift - SECTION=$1 - CLEAN_VENDOR=false - ;; - -c | --clean-vendor ) CLEAN_VENDOR=true - ;; +while [ "${#}" -gt 0 ]; do + case "${1}" in + -n | --no-cleanup ) + CLEAN_VENDOR=false + ;; + -k | --kang ) + KANG="--kang" + ;; + -s | --section ) + SECTION="${2}"; shift + CLEAN_VENDOR=false + ;; + * ) + SRC="${1}" + ;; esac shift done @@ -58,12 +62,14 @@ fi # Initialize the common helper setup_vendor "$DEVICE_COMMON" "$VENDOR" "$LINEAGE_ROOT" true $CLEAN_VENDOR -extract "$MY_DIR"/proprietary-files.txt "$SRC" "$SECTION" +extract "$MY_DIR"/proprietary-files.txt "$SRC" \ + "${KANG}" --section "${SECTION}" if [ -s "$MY_DIR"/../$DEVICE/proprietary-files.txt ]; then # Reinitialize the helper for device setup_vendor "$DEVICE" "$VENDOR" "$LINEAGE_ROOT" false "$CLEAN_VENDOR" - extract "$MY_DIR"/../$DEVICE/proprietary-files.txt "$SRC" "$SECTION" + extract "$MY_DIR"/../$DEVICE/proprietary-files.txt "$SRC" \ + "${KANG}" --section "${SECTION}" fi "$MY_DIR"/setup-makefiles.sh |