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 printf "package $pkg not found, ignoring\n" 1>&2
58 if [ -z "$pkglist" ]; then
59 printf "can't find any packages\n" 1>&2
66 q=$(zpm quote -q "$glob")
67 globlist="or path glob $q"
69 globlist=${globlist#'or '}
74 printf '.separator " "\n'
76 printf 'select %s\n' "$cols"
78 if [ $pkgonly -eq 0 ]; then
79 if [ -n "$cols" ]; then
84 printf "when filetype = 'd' then rtrim(path,'/') || '/'\n"
85 printf "when filetype = 'l' then printf('%%s -> %%s', path, target)\n"
86 if [ $showsoname -eq 1 ]; then
87 printf "when EL.soname is not null then printf('%%s (%%s)', path, EL.soname)\n"
89 printf "else path end as path\n"
91 printf "from packagefiles_pkgid PF\n"
92 if [ $showsoname -eq 1 ]; then
93 printf "left join elflibraries EL on EL.file = PF.hash\n"
95 if [ -n "$status" ]; then
96 printf "join packages P on P.package = PF.package and P.version = PF.version and P.release = PF.release\n"
99 if [ -n "$globlist" ]; then
100 printf "and (%s)\n" "$globlist"
102 if [ -n "$pkglist" ]; then
103 printf "and pkgid in (%s)\n" "$pkglist"
106 only) printf "and configuration = 1\n" ;;
107 exclude) printf "and configuration = 0\n" ;;
109 if [ -n "$status" ]; then
110 printf "and P.status = '%s'\n" "$status"
112 printf 'order by package,version collate vercmp, release, path\n'
114 } | zpm shell $pkgfile