From 6e981183df65e6f1a675057091d6d888e2ee70cd Mon Sep 17 00:00:00 2001 From: Vladimir Oltean Date: Fri, 18 Jan 2019 18:37:36 +0530 Subject: [PATCH] X00T: Update extractors and introduce kang mode Change-Id: Idc196359a7cb6fd8de53ebdc23700322486a2a7d --- extract-files.sh | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/extract-files.sh b/extract-files.sh index 7f19804..8d15e7e 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -22,42 +22,45 @@ VENDOR=asus # Load extract_utils and do some sanity checks MY_DIR="${BASH_SOURCE%/*}" -if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi +if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi -LINEAGE_ROOT="$MY_DIR"/../../.. +LINEAGE_ROOT="${MY_DIR}/../../.." -HELPER="$LINEAGE_ROOT"/vendor/lineage/build/tools/extract_utils.sh -if [ ! -f "$HELPER" ]; then - echo "Unable to find helper script at $HELPER" +HELPER="${LINEAGE_ROOT}/vendor/lineage/build/tools/extract_utils.sh" +if [ ! -f "${HELPER}" ]; then + echo "Unable to find helper script at ${HELPER}" exit 1 fi -. "$HELPER" +source "${HELPER}" # Default to sanitizing the vendor folder before extraction CLEAN_VENDOR=true +SECTION= +KANG= while [ "$1" != "" ]; do - case $1 in + case "$1" in -n | --no-cleanup ) CLEAN_VENDOR=false ;; + -k | --kang) KANG="--kang" + ;; -s | --section ) shift - SECTION=$1 + SECTION="$1" CLEAN_VENDOR=false ;; - * ) SRC=$1 + * ) SRC="$1" ;; esac shift done -if [ -z "$SRC" ]; then +if [ -z "${SRC}" ]; then SRC=adb fi # Initialize the helper -setup_vendor "$DEVICE" "$VENDOR" "$LINEAGE_ROOT" false "$CLEAN_VENDOR" - -extract "$MY_DIR"/proprietary-files.txt "$SRC" "$SECTION" +setup_vendor "${DEVICE}" "${VENDOR}" "${LINEAGE_ROOT}" false "${CLEAN_VENDOR}" -. "$MY_DIR"/setup-makefiles.sh +extract "${MY_DIR}/proprietary-files.txt" "${SRC}" ${KANG} --section "${SECTION}" +"${MY_DIR}/setup-makefiles.sh"