extract_utils: extract(): rename FILE variable to SPEC_SRC_FILE

* This is a cleanup patch.

Change-Id: I971b2b9eba5c1f303c0d5f902feaaad25b3b26ed
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
gugelfrei
Vladimir Oltean 6 years ago committed by Michael Bestas
parent 411e0695f2
commit da3b64413d

@ -982,9 +982,9 @@ function extract() {
for (( i=1; i<COUNT+1; i++ )); do for (( i=1; i<COUNT+1; i++ )); do
local SPEC_SRC_FILE=$(src_file "${FILELIST[$i-1]}")
local SPEC_DST_FILE=$(target_file "${FILELIST[$i-1]}") local SPEC_DST_FILE=$(target_file "${FILELIST[$i-1]}")
local ARGS=$(target_args "${FILELIST[$i-1]}") local ARGS=$(target_args "${FILELIST[$i-1]}")
local FILE=$(src_file "${FILELIST[$i-1]}")
local OUTPUT_DIR="$OUTPUT_ROOT" local OUTPUT_DIR="$OUTPUT_ROOT"
local TMP_DIR="$OUTPUT_TMP" local TMP_DIR="$OUTPUT_TMP"
local TARGET= local TARGET=
@ -995,7 +995,7 @@ function extract() {
TMP_DIR="$TMP_DIR/rootfs" TMP_DIR="$TMP_DIR/rootfs"
else else
TARGET="system/${SPEC_DST_FILE}" TARGET="system/${SPEC_DST_FILE}"
FILE="system/$FILE" SPEC_SRC_FILE="system/${SPEC_SRC_FILE}"
fi fi
if [ "$SRC" = "adb" ]; then if [ "$SRC" = "adb" ]; then
@ -1041,15 +1041,15 @@ function extract() {
adb pull "/$TARGET" "$DEST" adb pull "/$TARGET" "$DEST"
# if file does not exist try OEM target # if file does not exist try OEM target
if [ "$?" != "0" ]; then if [ "$?" != "0" ]; then
adb pull "/$FILE" "$DEST" adb pull "/${SPEC_SRC_FILE}" "$DEST"
fi fi
else else
# Try Lineage target first # Try Lineage target first
if [ -f "$SRC/$TARGET" ]; then if [ -f "$SRC/$TARGET" ]; then
cp "$SRC/$TARGET" "$DEST" cp "$SRC/$TARGET" "$DEST"
# if file does not exist try OEM target # if file does not exist try OEM target
elif [ -f "$SRC/$FILE" ]; then elif [ -f "$SRC/${SPEC_SRC_FILE}" ]; then
cp "$SRC/$FILE" "$DEST" cp "$SRC/${SPEC_SRC_FILE}" "$DEST"
else else
printf ' !! file not found in source\n' printf ' !! file not found in source\n'
fi fi
@ -1058,11 +1058,11 @@ function extract() {
if [ "$?" == "0" ]; then if [ "$?" == "0" ]; then
# Deodex apk|jar if that's the case # Deodex apk|jar if that's the case
if [[ "$FULLY_DEODEXED" -ne "1" && "$DEST" =~ .(apk|jar)$ ]]; then if [[ "$FULLY_DEODEXED" -ne "1" && "$DEST" =~ .(apk|jar)$ ]]; then
oat2dex "$DEST" "$FILE" "$SRC" oat2dex "$DEST" "${SPEC_SRC_FILE}" "$SRC"
if [ -f "$TMPDIR/classes.dex" ]; then if [ -f "$TMPDIR/classes.dex" ]; then
zip -gjq "$DEST" "$TMPDIR/classes.dex" zip -gjq "$DEST" "$TMPDIR/classes.dex"
rm "$TMPDIR/classes.dex" rm "$TMPDIR/classes.dex"
printf ' (updated %s from odex files)\n' "/$FILE" printf ' (updated %s from odex files)\n' "/${SPEC_SRC_FILE}"
fi fi
elif [[ "$DEST" =~ .xml$ ]]; then elif [[ "$DEST" =~ .xml$ ]]; then
fix_xml "$DEST" fix_xml "$DEST"

Loading…
Cancel
Save