tazpkg diff tazpkg-notify @ rev 471
Arf ust tagued and must push some some fix due to tazpkg change and new packages.up
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Fri Apr 08 17:58:27 2011 +0200 (2011-04-08) |
parents | 51c342baf04a |
children | 37c60822cee1 |
line diff
1.1 --- a/tazpkg-notify Wed Apr 06 01:24:08 2011 +0200 1.2 +++ b/tazpkg-notify Fri Apr 08 17:58:27 2011 +0200 1.3 @@ -22,7 +22,7 @@ 1.4 TEXTDOMAIN='tazpkg-notify' 1.5 export TEXTDOMAIN 1.6 1.7 -up=`cat $LOCALSTATE/upgradeable-packages.list | wc -l` 1.8 +up=`cat $LOCALSTATE/packages.up | wc -l` 1.9 rel=`cat /etc/slitaz-release` 1.10 1.11 # Kill the notification icon after user pressed on it. 1.12 @@ -33,16 +33,16 @@ 1.13 done 1.14 } 1.15 1.16 -# Message for upgradeable 1.17 -upgradeable_msg() { 1.18 - eval_gettext "<b>There is \$up upgradeable packages for your SliTaz \$ver</b> 1.19 +# Message for up 1.20 +up_msg() { 1.21 + eval_gettext "<b>There is \$up upgradeable packages for your SliTaz \$rel</b> 1.22 You should upgrade your system to get all latest fixes 1.23 and improvments from SliTaz contributors" 1.24 } 1.25 1.26 # Message for list older than 10 days 1.27 old_list_msg() { 1.28 - eval_gettext "<b>Your SliTaz \$ver packages list is older than 10 days.</b> 1.29 + eval_gettext "<b>Your SliTaz \$rel packages list is older than 10 days.</b> 1.30 You should recharge the list to check for updates" 1.31 } 1.32 1.33 @@ -54,9 +54,9 @@ 1.34 } 1.35 1.36 # 1.37 -# Main GUI box for upgradeable packages 1.38 +# Main GUI box for up packages 1.39 # 1.40 -upgradeable_main() { 1.41 +up_main() { 1.42 yad --text --width=400 \ 1.43 --geometry="$NOTIFY_GEOM" \ 1.44 --undecorated \ 1.45 @@ -64,29 +64,29 @@ 1.46 --image="tazpkg" \ 1.47 --image-on-top \ 1.48 --on-top \ 1.49 - --text="`upgradeable_msg`" \ 1.50 + --text="`up_msg`" \ 1.51 --button="`gettext \"Upgrade:2\"`" \ 1.52 --button="gtk-close:1" 1.53 } 1.54 1.55 -# Notification icon for upgradeable packages 1.56 -upgradeable_notify() { 1.57 +# Notification icon for up packages 1.58 +up_notify() { 1.59 yad --notification \ 1.60 --image=tazpkg \ 1.61 - --text="`upgradeable_msg`" \ 1.62 + --text="`up_msg`" \ 1.63 --command="tazpkg-notify upgrade" 1.64 } 1.65 1.66 -# Main upgradeable function 1.67 -upgradeable() { 1.68 +# Main up function 1.69 +up() { 1.70 # Store box results 1.71 - main=`upgradeable_main` 1.72 + main=`up_main` 1.73 ret=$? 1.74 kill_notification 1.75 # Deal with --button values 1.76 case $ret in 1.77 1) exit 0 ;; 1.78 - #tazweb http://tazpanel:8090/pkgs.cgi?upgradeable & 1.79 + #tazweb http://tazpanel:8090/pkgs.cgi?up & 1.80 2) subox tazpkgbox & ;; 1.81 *) continue ;; 1.82 esac 1.83 @@ -177,7 +177,7 @@ 1.84 1.85 case $1 in 1.86 upgrade) 1.87 - upgradeable ;; 1.88 + up ;; 1.89 old-list) 1.90 old_list ;; 1.91 no-list) 1.92 @@ -186,8 +186,8 @@ 1.93 # Sleep first to let tazpkg upgrade on boot finish. Check if 1.94 # any upgrade, then for an old list and then if any list at all 1.95 # (live or first boot) 1.96 - #sleep 15 1.97 - [ "$up" -gt 0 ] && upgradeable_notify && exit 0 1.98 + sleep 10 1.99 + [ "$up" -gt 0 ] && up_notify && exit 0 1.100 mtime=`find /var/lib/tazpkg/packages.list -mtime +10;` 1.101 [ "$mtime" ] && old_list_notify && exit 0 1.102 [ ! -f $LOCALSTATE/packages.list ] && no_list_notify \