]> pd.if.org Git - zpackage/commitdiff
warn on all missing packages
authorNathan Wagner <nw@hydaspes.if.org>
Fri, 7 Dec 2018 16:18:38 +0000 (16:18 +0000)
committerNathan Wagner <nw@hydaspes.if.org>
Fri, 7 Dec 2018 16:18:38 +0000 (16:18 +0000)
doc/zpm-contents.8
zpm-contents

index 4cdb964771f2e8f221338dcca8c5211d027a8193..4ac9c15e57314f88aa857833fc24e0aadc711e88 100644 (file)
@@ -7,18 +7,25 @@ zpm-contents \- list files in a zpm package
 .BI -f " pkgfile"
 ]
 [
-.I package ...
-]
-[
-.B --
-.I fileglob ...
+.B -ln
 ]
+.RI [ package ...]
+.RB [ --
+.IR glob ...\fR]
 .SH DESCRIPTION
-zpm-contents lists files belonging to any of the given packages,
+\fBzpm-contents\fR lists files belonging to any of the given packages,
 or all packages.  Additionally, the list of packages can be
 terminated with '--' and any additional arguments are glob patterns.
 .SH OPTIONS
-\-f specify the package file to find packages in
+.TP
+\-f
+specify the package file to find packages in
+.TP
+\-n
+list file paths only
+.TP
+\-l
+long listing, with file mode and ownership, overrides \-n
 .SH EXAMPLES
 zpm contents 
 .SH EXIT STATUS
index 18fac9443dc45360dbb947f89c7bfcf40042c12f..60ec1f534807e05d6ad2817f434f256e890a3d9a 100755 (executable)
@@ -41,28 +41,28 @@ elif [ $quiet -eq 0 ]; then
 fi
 
 pkglist=
+efail=0
 while [ $# -gt 0 ]; do
        pkg=$1
        shift
+
        if [ "$pkg" = '--' ]; then
-               break;
+               break
        fi
 
        pkgid=$(zpm findpkg -f $pkgfile "$pkg")
        if [ -n "$pkgid" ]; then
-               q=$(zpm quote -q "$pkgid")
-               pkglist=",$q"
+               pkglist="$pkglist $pkgid"
        else
-               printf "package $pkg not found, ignoring\n" 1>&2
-               exit 1
-       fi
-       pkglist=${pkglist#,}
-       if [ -z "$pkglist" ]; then
-               printf "can't find any packages\n" 1>&2
-               exit 1
+               printf "package $pkg not found\n" 1>&2
+               efail=1
        fi
 done
 
+if [ $efail -eq 1 ]; then
+       exit 1;
+fi
+
 globlist=
 for glob in "$@"; do
        q=$(zpm quote -q "$glob")
@@ -102,7 +102,7 @@ cols=${cols%,}
                printf "and (%s)\n" "$globlist"
        fi
        if [ -n "$pkglist" ]; then
-               printf "and pkgid in (%s)\n" "$pkglist"
+               printf "and pkgid in (%s)\n" "$(zpm quote -d, -q $pkglist)"
        fi
        case $config in
                only) printf "and configuration = 1\n" ;;