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
gugelfrei
Adrian DC 6 years ago committed by Michael Bestas
parent 6393a3f083
commit a8e06d3593

@ -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

Loading…
Cancel
Save