Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save updateing/993f7fa3a8bb7ca883722707298ae057 to your computer and use it in GitHub Desktop.
Save updateing/993f7fa3a8bb7ca883722707298ae057 to your computer and use it in GitHub Desktop.
From 8b4fe866ab376de4e946a212f3d86ef4fcb3a572 Mon Sep 17 00:00:00 2001
From: Hamster Tian <haotia@gmail.com>
Date: Sat, 31 Mar 2018 16:14:41 +0800
Subject: [PATCH] extract_utils: support copying packages to different
destination
c982836ca6292ac0dd1d2e326be22dc1131b2484 stripped source information
from lines starting with -, and the files will be copied from
target path, leading to "file not found" errors.
Fix this by postponing stripping until generation of Android.mk,
so that file copying logic knows where the actual file is.
Change-Id: I480816274ecb1300942b7e7973b6fe2d99d585a9
---
build/tools/extract_utils.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/build/tools/extract_utils.sh b/build/tools/extract_utils.sh
index d7fab19..5815a19 100644
--- a/build/tools/extract_utils.sh
+++ b/build/tools/extract_utils.sh
@@ -149,8 +149,9 @@ function target_args() {
function prefix_match() {
local PREFIX="$1"
for FILE in "${PRODUCT_PACKAGES_LIST[@]}"; do
- if [[ "$FILE" =~ ^"$PREFIX" ]]; then
- printf '%s\n' "${FILE#$PREFIX}"
+ local FILE_TARGET=${FILE#*\:}
+ if [[ "$FILE_TARGET" =~ ^"$PREFIX" ]]; then
+ printf '%s\n' "${FILE_TARGET#$PREFIX}"
fi
done
}
@@ -641,7 +642,6 @@ function parse_file_list() {
# if line starts with a dash, it needs to be packaged
if [[ "$SPEC" =~ ^- ]]; then
- SPEC=$(echo "${SPEC}" | sed 's/[^"]*://')
PRODUCT_PACKAGES_LIST+=("${SPEC#-}")
PRODUCT_PACKAGES_HASHES+=("$HASH")
else
--
2.11.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment