3 pkgfile=${ZPMDB:-/var/lib/zpm/local.db}
12 while getopts f:qlncCLI opt; do
14 f) pkgfile="$OPTARG" ;;
26 if [ ! -f $pkgfile ]; then
27 echo cannot find $pkgfile
31 if [ $long -gt 0 ]; then
32 cols="filetype,printf('%.4s', mode) as mode,username,groupname,"
35 if [ $pkgonly -eq 1 ]; then
37 elif [ $quiet -eq 0 ]; then
42 while [ $# -gt 0 ]; do
45 if [ "$pkg" = '--' ]; then
49 pkgid=$(zpm findpkg -f $pkgfile "$pkg")
50 if [ -n "$pkgid" ]; then
51 q=$(zpm quote -q "$pkgid")
54 warn "package $pkg not found, ignoring"
61 q=$(zpm quote -q "$glob")
62 globlist="or path glob $q"
64 globlist=${globlist#'or '}
69 printf '.separator " "\n'
70 printf 'select %s\n' "$cols"
72 if [ $pkgonly -eq 0 ]; then
73 if [ -n "$cols" ]; then
78 printf "when filetype = 'd' then rtrim(path,'/') || '/'\n"
79 printf "when filetype = 'l' then printf('%%s -> %%s', path, target)\n"
80 if [ $showsoname -eq 1 ]; then
81 printf "when EL.soname is not null then printf('%%s (%%s)', path, EL.soname)\n"
83 printf "else path end as path\n"
85 printf 'from packagefiles_status PF left join elflibraries EL on EL.file = PF.hash\nwhere true\n'
86 if [ -n "$globlist" ]; then
87 printf "and (%s)\n" "$globlist"
89 if [ -n "$pkglist" ]; then
90 printf "and pkgid in (%s)\n" "$pkglist"
93 only) printf "and configuration = 1\n" ;;
94 exclude) printf "and configuration = 0\n" ;;
96 if [ -n "$status" ]; then
97 printf "and status = '%s'\n" "$status"
99 printf 'order by pkgid,path\n'
101 } | zpm shell $pkgfile