Update this script to match pkgman behaviour

We don't need to move away older packages anymore.

Probably not useful either to stop Deskbar,
but let's just keep that for now.
This commit is contained in:
François Revol
2014-08-04 00:21:58 +02:00
parent 92d556084c
commit 05f06a9065
+10 -29
View File
@@ -17,47 +17,28 @@ if [ "$1" != "-2" ]; then
notice "Closing Deskbar..." notice "Closing Deskbar..."
notice "Checking for updates..." notice "Checking for updates..."
quit application/x-vnd.Be-TSKB quit application/x-vnd.Be-TSKB
#notice "Checking for updates..."
pkgman update || exit $?
sync sync
if [ "$(ls /system/packages/*_hrev*-* | grep -v $(uname -v | cut -d' ' -f1))" = "" ]; then hrev_current="$(uname -v | cut -d' ' -f1)"
pkgman update
pkgman_err=$?
sync
if [ $pkgman_err -gt 0 -o "$(ls /system/packages/*_hrev*-* | grep -v $hrev_current)" = "" ]; then
open /system/Deskbar < /dev/null > /dev/null 2>&1 & open /system/Deskbar < /dev/null > /dev/null 2>&1 &
notice "Restarting Deskbar..." notice "Restarting Deskbar..."
notice "Nothing to do" #notice "Nothing to do"
read read -p "Press a key..."
exit 0 exit $pkgman_err
fi fi
makebootable /boot makebootable /boot
sync sync
cat > $(finddir B_USER_SETTINGS_DIRECTORY)/boot/launch/myupdate2.sh << EOF
#!/bin/sh
cd "$PWD"
$0 -2
EOF
chmod +x $(finddir B_USER_SETTINGS_DIRECTORY)/boot/launch/myupdate2.sh
sync
notice "Restarting Deskbar..." notice "Restarting Deskbar..."
/system/Deskbar < /dev/null > /dev/null 2>&1 & /system/Deskbar < /dev/null > /dev/null 2>&1 &
notice "You should reboot now..." notice "You should reboot now..."
shutdown -r -a shutdown -r -a
read sleep 5
#read
exit 0 exit 0
fi fi
rm $(finddir B_USER_SETTINGS_DIRECTORY)/boot/launch/myupdate2.sh rm $(finddir B_USER_SETTINGS_DIRECTORY)/boot/launch/myupdate2.sh
disdir="$(finddir B_SYSTEM_PACKAGES_DIRECTORY)/disabled"
mkdir -p "$disdir"
notice "Moving old packages to disabled/ ..."
mv $(ls /system/packages/*_hrev*-* | grep -v $(uname -v | cut -d' ' -f1)) $disdir/
sync
#notice "Adding back deskbar addons..."
#ProcessController -deskbar
#NetworkStatus --deskbar
notice "Done"
read