X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=zpm-list;h=7ea697bf1e04ae1323dd33b373f3e9a04d561fca;hb=ce38dde467cb64991032812eaaac31deb3c39da5;hp=0dda9daa68223dfd0ec231a6c8e014e5d1f41d65;hpb=51a6d79f8a532376a9f27dbb5133bf13a5474703;p=zpackage diff --git a/zpm-list b/zpm-list index 0dda9da..7ea697b 100755 --- a/zpm-list +++ b/zpm-list @@ -4,18 +4,22 @@ verbose=0 nameonly=0 +latestonly=1 -while getopts :s:f:vn opt; do +while getopts :s:f:vnIF: opt; do case $opt in f) pkgfile="$OPTARG" ;; s) status="$OPTARG" ;; + I) status=installed ;; v) verbose=1 ;; n) nameonly=1 ;; + a) latestonly=0 ;; + F) filter="$OPTARG" ;; esac done shift $(( OPTIND - 1)) -: ${pkgfile:=$ZPMDB} +: ${pkgfile:=${ZPMDB:-/var/lib/zpm/local.db}} if [ -z "$pkgfile" ]; then echo "must specify package file" @@ -34,7 +38,11 @@ fi if [ -n "$status" ]; then status=$(zpm quote "$status") - where="where status = '$status'" + where="and status = '$status'" +fi + +if [ -n "$filter" ]; then + where="$where and ($filter)" fi pkgid=$1 @@ -57,6 +65,10 @@ fi zpm shell $pkgfile <&2 +fi