From a8e06d35939caa3dff07922c041a43f8de92fb59 Mon Sep 17 00:00:00 2001 From: Adrian DC Date: Sun, 17 Jun 2018 00:15:00 +0200 Subject: [PATCH] envsetup: Filter unique push paths in dopush * Reverse the FILE and TARGET handling to sort and filter unique paths to be pushed * Resolves the 'mkap systemimage' where /system/etc/nano/* symlinks were pushed multiple times in loops Change-Id: I178cec2e1708ad9239d9e544544fca157639e3b5 --- build/envsetup.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build/envsetup.sh b/build/envsetup.sh index 3132a65e..a2b668a2 100644 --- a/build/envsetup.sh +++ b/build/envsetup.sh @@ -871,12 +871,12 @@ EOF fi stop_n_start=false - for FILE in $(echo $LOC | tr " " "\n"); do + for TARGET in $(echo $LOC | tr " " "\n" | sed "s#.*$OUT##" | sort | uniq); do # Make sure file is in $OUT/system or $OUT/data - case $FILE in - $OUT/system/*|$OUT/data/*) - # Get target file name (i.e. /system/bin/adb) - TARGET=$(echo $FILE | sed "s#$OUT##") + case $TARGET in + /system/*|/data/*) + # Get out file from target (i.e. /system/bin/adb) + FILE=$OUT$TARGET ;; *) continue ;; esac