X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=zpm-rmpackage;h=98eac6ee48b53f75a21738df9961377e2054dafc;hb=69491d14441cfc893e18e1c60c13c995b93002c9;hp=4e8f10768686b4c991f528c76b5dd2f293066f61;hpb=9dc0c4f6a9ecb1f45eb8f329a9d977b7515f574e;p=zpackage diff --git a/zpm-rmpackage b/zpm-rmpackage index 4e8f107..98eac6e 100755 --- a/zpm-rmpackage +++ b/zpm-rmpackage @@ -5,11 +5,13 @@ pkgfile=${ZPM_PACKAGE_FILE:-${ZPMDB:-/var/lib/zpm/local.db}} verbose=0 # newpackage -f pkgfile $pkgid -while getopts :f:vm: opt; do +while getopts :f:vm:s:S: opt; do case $opt in f) pkgfile="$OPTARG" ;; v) verbose=1 ;; m) message="$OPTARG" ;; + s) status="$status -s $OPTARG" ;; + S) exclude="$exclude -S $OPTARG" ;; esac done shift $(( OPTIND - 1)) @@ -35,14 +37,14 @@ fi { printf ".bail on\n" + printf ".echo on\n" printf "begin;\n" for pkgstr in "$@"; do - pkgid=$(zpm findpkg -f $pkgfile "$pkgstr") + pkgid=$(zpm findpkg $status $exclude -f $pkgfile "$pkgstr") + if [ -z "$pkgid" ]; then + continue; + fi if [ $verbose -gt 0 ]; then - if [ -z "$pkgid" ]; then - warn "$pkgstr not found" - continue; - fi if [ $verbose -gt 1 ]; then warn "found %s -> %s\n" "$pkgstr", "$pkgid" fi