# HG changeset patch # User Pascal Bellard # Date 1266879439 -3600 # Node ID 9a31214054288fbd10f1752c8b8fa5c8d73d336a # Parent 2359a2ec4858d3310272964ff3123c3078171aec show upgradeable packages diff -r 2359a2ec4858 -r 9a3121405428 lib/tazpkgbox/list --- a/lib/tazpkgbox/list Tue Feb 16 10:20:13 2010 +0000 +++ b/lib/tazpkgbox/list Mon Feb 22 23:57:19 2010 +0100 @@ -79,7 +79,7 @@ blocked_list() { - for pkg in $(cat /var/lib/tazpkg/blocked-packages.list 2> /dev/null); do + for pkg in $(cat /var/lib/tazpkg/$1-packages.list 2> /dev/null); do [ -f /var/lib/tazpkg/installed/$pkg/receipt ] || continue . /var/lib/tazpkg/installed/$pkg/receipt AVAILABLE=$(grep -s "^$pkg " /var/lib/tazpkg/packages.desc \ @@ -92,8 +92,8 @@ all) STATUS=`cat /tmp/tazpkgbox/status` case $STATUS in - blocked) - blocked_list ;; + blocked|upgradeable) + blocked_list $STATUS;; installed) CAT=`cat /tmp/tazpkgbox/category` installed_list ;; @@ -111,10 +111,10 @@ else undigest_list $2 | grep "$1" fi ;; - blocked) - blocked_list ;; + blocked|upgradeable) + blocked_list $1;; *) - echo "Usage: $0 [all|undigest|blocked]" ;; + echo "Usage: $0 [all|undigest|blocked|upgradeable]" ;; esac exit 0 diff -r 2359a2ec4858 -r 9a3121405428 tazpkg --- a/tazpkg Tue Feb 16 10:20:13 2010 +0000 +++ b/tazpkg Mon Feb 22 23:57:19 2010 +0100 @@ -113,6 +113,7 @@ repack-config Create a package archive with configuration files. recompress Rebuild a package with the better compression ratio. upgrade Upgrade one or all installed/listed package(s) on the mirror. + upgradeable Build upgradeable packages list quickly. block|unblock Block an installed package version or unblock it for upgrade. get Download a package into the current directory. get-install Download and install a package from the mirror. @@ -2100,6 +2101,20 @@ a list of differences will be displayed to show new and upgradeable packages.\n" fi done ;; + upgradeable) + # Build upgradeable-packages.list quickly. + # + check_root + cd $LOCALSTATE + while read md5 file ; do + grep -qs "$md5 $file" packages.md5 && continue + for i in 1 2 3 4 5; do + file=${file%-*} + [ -d installed/$file ] || continue + echo $file + break + done + done < installed.md5 > upgradeable-packages.list ;; upgrade) # Upgrade all installed packages with the new version from the mirror. # diff -r 2359a2ec4858 -r 9a3121405428 tazpkgbox --- a/tazpkgbox Tue Feb 16 10:20:13 2010 +0000 +++ b/tazpkgbox Mon Feb 22 23:57:19 2010 +0100 @@ -295,6 +295,7 @@ installed installable blocked + upgradeable @@ -534,7 +535,7 @@