pkgfile=${ZPMDB:-/var/lib/zpm/db.zpm}
-while getopts f: opt; do
+verbose=0
+
+while getopts f:v opt; do
case $opt in
f) pkgfile="$OPTARG" ;;
+ v) verbose=1
esac
done
shift $((OPTIND - 1))
exit 1
fi
+cols=
+if [ $verbose -gt 0 ]; then
+ cols="filetype,printf('%4.4s', mode) as mode,username,groupname,"
+fi
for pkg in "$@"; do
pkgid=$(zpm findpkg -f $pkgfile $pkg)
zpm shell $pkgfile <<EOS
-.separator "\t"
-select package, version, release,
-path || case when hash is null then '/' else '' end
-from packagefiles
-where printf('%s-%s-%s', package,version,release) = '$pkgid'
+.separator " "
+select pkgid, $cols
+case when filetype = 'd' then
+ rtrim(path,'/') || '/'
+else
+ path
+end as path
+from packagefiles_pkgid
+where pkgid = '$pkgid'
+order by path
;
EOS