.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
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")
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" ;;