]> pd.if.org Git - zpackage/blob - zpm-contents
change findpkg to use -f option
[zpackage] / zpm-contents
1 #!/bin/sh
2
3 pkgfile=${ZPMDB:-/var/lib/zpm/db.zpm}
4
5 while getopts f: opt; do
6         case $opt in
7                 f) pkgfile="$OPTARG" ;;
8         esac
9 done
10 shift $((OPTIND - 1))
11
12 set -e
13
14 if [ ! -f $pkgfile ]; then
15         echo cannot find $pkgfile
16         exit 1
17 fi
18
19
20 for pkg in "$@"; do
21         pkgid=$(zpm findpkg -f $pkgfile $pkg)
22
23         zpm shell $pkgfile <<EOS
24 .separator "\t"
25 select package, version, release,
26 path || case when hash is null then '/' else '' end
27 from packagefiles
28 where printf('%s-%s-%s', package,version,release) = '$pkgid'
29 ;
30 EOS
31
32 done