tazpkg rev 319
show upgradeable packages
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Feb 22 23:57:19 2010 +0100 (2010-02-22) |
parents | 2359a2ec4858 |
children | 8bdf4568fdb5 |
files | lib/tazpkgbox/list tazpkg tazpkgbox |
line diff
1.1 --- a/lib/tazpkgbox/list Tue Feb 16 10:20:13 2010 +0000 1.2 +++ b/lib/tazpkgbox/list Mon Feb 22 23:57:19 2010 +0100 1.3 @@ -79,7 +79,7 @@ 1.4 1.5 blocked_list() 1.6 { 1.7 - for pkg in $(cat /var/lib/tazpkg/blocked-packages.list 2> /dev/null); do 1.8 + for pkg in $(cat /var/lib/tazpkg/$1-packages.list 2> /dev/null); do 1.9 [ -f /var/lib/tazpkg/installed/$pkg/receipt ] || continue 1.10 . /var/lib/tazpkg/installed/$pkg/receipt 1.11 AVAILABLE=$(grep -s "^$pkg " /var/lib/tazpkg/packages.desc \ 1.12 @@ -92,8 +92,8 @@ 1.13 all) 1.14 STATUS=`cat /tmp/tazpkgbox/status` 1.15 case $STATUS in 1.16 - blocked) 1.17 - blocked_list ;; 1.18 + blocked|upgradeable) 1.19 + blocked_list $STATUS;; 1.20 installed) 1.21 CAT=`cat /tmp/tazpkgbox/category` 1.22 installed_list ;; 1.23 @@ -111,10 +111,10 @@ 1.24 else 1.25 undigest_list $2 | grep "$1" 1.26 fi ;; 1.27 - blocked) 1.28 - blocked_list ;; 1.29 + blocked|upgradeable) 1.30 + blocked_list $1;; 1.31 *) 1.32 - echo "Usage: $0 [all|undigest|blocked]" ;; 1.33 + echo "Usage: $0 [all|undigest|blocked|upgradeable]" ;; 1.34 esac 1.35 1.36 exit 0
2.1 --- a/tazpkg Tue Feb 16 10:20:13 2010 +0000 2.2 +++ b/tazpkg Mon Feb 22 23:57:19 2010 +0100 2.3 @@ -113,6 +113,7 @@ 2.4 repack-config Create a package archive with configuration files. 2.5 recompress Rebuild a package with the better compression ratio. 2.6 upgrade Upgrade one or all installed/listed package(s) on the mirror. 2.7 + upgradeable Build upgradeable packages list quickly. 2.8 block|unblock Block an installed package version or unblock it for upgrade. 2.9 get Download a package into the current directory. 2.10 get-install Download and install a package from the mirror. 2.11 @@ -2100,6 +2101,20 @@ 2.12 a list of differences will be displayed to show new and upgradeable packages.\n" 2.13 fi 2.14 done ;; 2.15 + upgradeable) 2.16 + # Build upgradeable-packages.list quickly. 2.17 + # 2.18 + check_root 2.19 + cd $LOCALSTATE 2.20 + while read md5 file ; do 2.21 + grep -qs "$md5 $file" packages.md5 && continue 2.22 + for i in 1 2 3 4 5; do 2.23 + file=${file%-*} 2.24 + [ -d installed/$file ] || continue 2.25 + echo $file 2.26 + break 2.27 + done 2.28 + done < installed.md5 > upgradeable-packages.list ;; 2.29 upgrade) 2.30 # Upgrade all installed packages with the new version from the mirror. 2.31 #
3.1 --- a/tazpkgbox Tue Feb 16 10:20:13 2010 +0000 3.2 +++ b/tazpkgbox Mon Feb 22 23:57:19 2010 +0100 3.3 @@ -295,6 +295,7 @@ 3.4 <item>installed</item> 3.5 <item>installable</item> 3.6 <item>blocked</item> 3.7 + <item>upgradeable</item> 3.8 </combobox> 3.9 <text> 3.10 <label>"Category:"</label> 3.11 @@ -534,7 +535,7 @@ 3.12 <button> 3.13 <label>Recharge lists</label> 3.14 <input file icon="system-software-update"></input> 3.15 - <action>xterm -T "Recharge" -geometry 80x16+120+120 -e "tazpkg recharge; sleep 2" 2>/dev/null</action> 3.16 + <action>xterm -T "Recharge" -geometry 80x16+120+120 -e "tazpkg recharge ; tazpkg upgradeable" 2>/dev/null</action> 3.17 <action>refresh:DEV</action> 3.18 <action>refresh:PKG</action> 3.19 <action>refresh:PKG_STATS</action>