tazpkg annotate lib/tazpkgbox/list @ rev 130
tazpkgbox: add installable tab, auto install depends checkbox and improve non-free support
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Jul 18 14:14:13 2008 +0000 (2008-07-18) |
parents | dec437264c66 |
children | a0d51bc28e4e |
rev | line source |
---|---|
pankso@81 | 1 #!/bin/sh |
pankso@81 | 2 # |
pankso@81 | 3 # List installed packages in a suitable format for GTK tree. |
pankso@81 | 4 # List mirrored packages using the packages.desc file. |
pankso@81 | 5 # |
pankso@81 | 6 |
pascal@130 | 7 installable_list() |
pascal@130 | 8 { |
pascal@130 | 9 IFS="|" |
pascal@130 | 10 while read PACKAGE VERSION SHORT_DESC; do |
pascal@130 | 11 [ -d /var/lib/tazpkg/installed/${PACKAGE%% *} ] && continue |
pascal@130 | 12 echo "$PACKAGE|$VERSION|$SHORT_DESC" |
pascal@130 | 13 done < /var/lib/tazpkg/packages.desc 2> /dev/null |
pascal@130 | 14 unset IFS |
pascal@130 | 15 } |
pascal@130 | 16 |
pascal@130 | 17 installed_list() |
pascal@130 | 18 { |
pascal@130 | 19 for pkg in /var/lib/tazpkg/installed/* |
pascal@130 | 20 do |
pascal@130 | 21 . $pkg/receipt |
pascal@130 | 22 if [ "$CAT" == "all" -o "$CATEGORY" == "$CAT" ]; then |
pascal@130 | 23 echo "$PACKAGE|$VERSION|$SHORT_DESC" |
pascal@130 | 24 fi |
pascal@130 | 25 done |
pascal@130 | 26 } |
pascal@130 | 27 |
pankso@81 | 28 case $1 in |
pankso@81 | 29 installed) |
pankso@81 | 30 CAT=`cat /tmp/tazpkgbox/installed-category` |
pascal@130 | 31 installed_list $CAT;; |
pascal@130 | 32 installable) |
pascal@130 | 33 CAT=`cat /tmp/tazpkgbox/installable-category` |
pankso@81 | 34 if [ "$CAT" == "all" ]; then |
pascal@130 | 35 installable_list |
pankso@81 | 36 else |
pascal@130 | 37 installable_list | grep "$CAT" |
pankso@81 | 38 fi ;; |
pankso@81 | 39 mirrored) |
pankso@81 | 40 CAT=`cat /tmp/tazpkgbox/mirrored-category` |
pankso@81 | 41 if [ "$CAT" == "all" ]; then |
pankso@81 | 42 cat /var/lib/tazpkg/packages.desc |
pankso@81 | 43 else |
pankso@81 | 44 grep "$CAT" /var/lib/tazpkg/packages.desc |
pankso@81 | 45 fi ;; |
pankso@81 | 46 *) |
pascal@130 | 47 echo "Usage: /usr/lib/slitaz/tazpkgbox/list [installed|installable|mirrored]" ;; |
pankso@81 | 48 esac |
pankso@81 | 49 |
pankso@81 | 50 exit 0 |