From f66d76f4414111f79dc73eb0f8b76f12741b4b81 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 4 Apr 2009 21:56:55 +0200 Subject: pkg: pkg_list: Also list not-installed packages, depending on argument --- bin/pkg | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'bin/pkg') diff --git a/bin/pkg b/bin/pkg index 965af60..55f493d 100755 --- a/bin/pkg +++ b/bin/pkg @@ -706,8 +706,20 @@ function pkg_upgrade { fi } -function pkg_list_installed { - cut -d ' ' -f 1 $PDIR/.list +function pkg_list { + case $1 in + ''|local) + cut -d ' ' -f 1 $PDIR/.list + ;; + all|remote) + cut -d ' ' -f 1 $PDIR/.list-remote + ;; + not-installed) + while read package crap; do + grep "^$package" $PDIR/.list &> /dev/null || echo $package + done < $PDIR/.list-remote + ;; + esac } function pkg_list_available { @@ -833,8 +845,7 @@ case $action in delete) pkg_remove $* ;; info) pkg_info $* ;; install) pkg_add $* ;; - list) pkg_list_installed $* ;; - list-all) pkg_list_available $* ;; + list) pkg_list $* ;; local-update) pkg_update_local $* ;; log) pkg_log $* ;; push) -- cgit v1.2.3