Skip to content

Commit

Permalink
envsetup: eat safely
Browse files Browse the repository at this point in the history
Change-Id: I2d8b52206213d8f4d8dcce3518cadb2be59e78d8
  • Loading branch information
ladios committed Aug 22, 2011
1 parent c3db3df commit d21e837
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions envsetup.sh
Expand Up @@ -630,16 +630,22 @@ function eat()
if [ "$OUT" ] ; then
MODVERSION=`sed -n -e'/ro\.modversion/s/^.*CyanogenMod-//p' $OUT/system/build.prop`
ZIPFILE=$OUT/update-cm-$MODVERSION-signed.zip
if [ $(adb get-state) != device ] ; then
echo "No device is online. Waiting for one..."
adb wait-for-device
fi
echo "Pushing update-cm-$MODVERSION-signed.zip to device"
adb push $ZIPFILE /mnt/sdcard/
cat << EOF > /tmp/extendedcommand
if adb push $ZIPFILE /mnt/sdcard/ ; then
cat << EOF > /tmp/extendedcommand
ui_print("Nom nom nom nom...");
install_zip("/sdcard/update-cm-$MODVERSION-signed.zip");
EOF
adb push /tmp/extendedcommand /cache/recovery/
rm /tmp/extendedcommand
echo "Rebooting into recovery for installation"
adb reboot recovery
if adb push /tmp/extendedcommand /cache/recovery/ ; then
echo "Rebooting into recovery for installation"
adb reboot recovery
fi
rm /tmp/extendedcommand
fi
else
echo "Nothing to eat"
return 1
Expand Down

0 comments on commit d21e837

Please sign in to comment.