summaryrefslogtreecommitdiffstats
path: root/envsetup.sh
diff options
context:
space:
mode:
authorMatt Mower <mowerm@gmail.com>2014-05-20 02:52:23 -0500
committerAdnan Begovic <adnan@cyngn.com>2015-10-06 16:33:26 -0700
commit668ea26c9a26432abb32e8fa37d9d78b7a95b063 (patch)
treee1f004745bfcb64abd78fb3b22e2e355481f14ff /envsetup.sh
parentf8f5dbf353552648da6b165b9968e69675a9dbbc (diff)
downloadbuild-668ea26c9a26432abb32e8fa37d9d78b7a95b063.zip
build-668ea26c9a26432abb32e8fa37d9d78b7a95b063.tar.gz
build-668ea26c9a26432abb32e8fa37d9d78b7a95b063.tar.bz2
envsetup: fixup dopush
* After clobber, $OUT does not exist and tee cannot create .log; fix this by calling mkdir -p $OUT * Make sure Copy and Install are at the beginning of the log line being analyzed and also search for ':' so that "Copying:" lines don't count * Fix Copy file list by quoting so shell doesn't think this is a command: $LOC $(...) * Fix 'only copy files from $OUT' now that multiple file pushing works right * Only stop java services once (if needed) and then wait to restart services until after all files have been pushed * Change location of SystemUI.apk to priv-app Signed-off-by: Chirayu Desai <cdesai@cyanogenmod.org> Change-Id: I65edd34bf445b28c2638cb3e9621719121fb962f
Diffstat (limited to 'envsetup.sh')
-rw-r--r--envsetup.sh46
1 files changed, 27 insertions, 19 deletions
diff --git a/envsetup.sh b/envsetup.sh
index 5d3ab3e..29b69ab 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -2063,37 +2063,45 @@ function dopush()
sleep 0.3
adb remount &> /dev/null
+ mkdir -p $OUT
$func $* | tee $OUT/.log
# Install: <file>
- LOC=$(cat $OUT/.log | sed -r 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' | grep 'Install' | cut -d ':' -f 2)
+ LOC="$(cat $OUT/.log | sed -r 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' | grep '^Install: ' | cut -d ':' -f 2)"
# Copy: <file>
- LOC=$LOC $(cat $OUT/.log | sed -r 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' | grep 'Copy' | cut -d ':' -f 2)
+ LOC="$LOC $(cat $OUT/.log | sed -r 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' | grep '^Copy: ' | cut -d ':' -f 2)"
+ stop_n_start=false
for FILE in $LOC; do
- # Get target file name (i.e. system/bin/adb)
- TARGET=$(echo $FILE | sed "s#$OUT/##")
+ # Make sure file is in $OUT/system
+ case $FILE in
+ $OUT/system/*)
+ # Get target file name (i.e. /system/bin/adb)
+ TARGET=$(echo $FILE | sed "s#$OUT##")
+ ;;
+ *) continue ;;
+ esac
- # Don't send files that are not under /system or /data
- if [ ! "echo $TARGET | egrep '^system\/' > /dev/null" -o \
- "echo $TARGET | egrep '^data\/' > /dev/null" ] ; then
- continue
- else
- case $TARGET in
- system/app/SystemUI.apk|system/framework/*)
- stop_n_start=true
+ case $TARGET in
+ /system/priv-app/SystemUI.apk|/system/framework/*)
+ # Only need to stop services once
+ if ! $stop_n_start; then
+ adb shell stop
+ stop_n_start=true
+ fi
+ echo "Pushing: $TARGET"
+ adb push $FILE $TARGET
;;
*)
- stop_n_start=false
+ echo "Pushing: $TARGET"
+ adb push $FILE $TARGET
;;
- esac
- if $stop_n_start ; then adb shell stop ; fi
- echo "Pushing: $TARGET"
- adb push $FILE $TARGET
- if $stop_n_start ; then adb shell start ; fi
- fi
+ esac
done
+ if $stop_n_start; then
+ adb shell start
+ fi
rm -f $OUT/.log
return 0
else