summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Stefani <luca.stefani.ge1@gmail.com>2016-07-30 12:08:25 +0200
committerSteve Kondik <shade@chemlab.org>2016-08-05 00:01:45 -0700
commit3a03012242c8303b3616e0630c42992070920fc7 (patch)
tree5a48a9ef452fd292197125ae7844e53e6c782e47
parent7f9fff2317b8e1f64b2a74ae6c6447f537737b14 (diff)
downloadvendor_replicant-3a03012242c8303b3616e0630c42992070920fc7.zip
vendor_replicant-3a03012242c8303b3616e0630c42992070920fc7.tar.gz
vendor_replicant-3a03012242c8303b3616e0630c42992070920fc7.tar.bz2
cm: extract_utils: Fixup xml files
Change-Id: Icb8efcca0e6e37a3ea7432716fcbfbd631d96c19
-rw-r--r--build/tools/extract_utils.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/build/tools/extract_utils.sh b/build/tools/extract_utils.sh
index b4b8faf..309a8a9 100644
--- a/build/tools/extract_utils.sh
+++ b/build/tools/extract_utils.sh
@@ -653,6 +653,21 @@ function init_adb_connection() {
}
#
+# fix_xml:
+#
+# $1: xml file to fix
+#
+function fix_xml() {
+ local XML="$1"
+ local TEMP_XML="$TMPDIR/`basename "$XML"`.temp"
+
+ grep '^<?xml version' "$XML" > "$TEMP_XML"
+ grep -v '^<?xml version' "$XML" >> "$TEMP_XML"
+
+ mv "$TEMP_XML" "$XML"
+}
+
+#
# extract:
#
# $1: file containing the list of items to extract
@@ -739,6 +754,8 @@ function extract() {
rm "$TMPDIR/classes.dex"
printf ' (updated %s from odex files)\n' "/$FILE"
fi
+ elif [[ "$DEST" =~ .xml$ ]]; then
+ fix_xml "$DEST"
fi
fi