]> pd.if.org Git - zpackage/commitdiff
add options to control config file listing
authorNathan Wagner <nw@hydaspes.if.org>
Sat, 3 Nov 2018 12:17:03 +0000 (12:17 +0000)
committerNathan Wagner <nw@hydaspes.if.org>
Sat, 3 Nov 2018 12:41:10 +0000 (12:41 +0000)
zpm-contents

index 8b7dde005b9f2314da725bfab9f8a5686e6273d0..6bc470e51e9c59fa0c74cae9657ac20de8c48fd6 100755 (executable)
@@ -5,13 +5,16 @@ pkgfile=${ZPMDB:-/var/lib/zpm/db.zpm}
 long=0
 pkgonly=0
 quiet=0
+config=include
 
-while getopts f:qln opt; do
+while getopts f:qlncC opt; do
        case $opt in
                f) pkgfile="$OPTARG" ;;
                l) long=1 ;;
                n) pkgonly=1 ;;
                q) quiet=1 ;;
+               c) config=only ;;
+               C) config=exclude ;;
        esac
 done
 shift $((OPTIND - 1))
@@ -79,6 +82,10 @@ cols=${cols%,}
        if [ -n "$pkglist" ]; then
                printf "and pkgid in (%s)\n" "$pkglist"
        fi
+       case $config in
+               only) printf "and configuration = 1\n" ;;
+               exclude) printf "and configuration = 0\n" ;;
+       esac
        printf 'order by pkgid,path\n'
        printf ';\n'
 } | zpm shell $pkgfile