3 # zpm-list [-s status] [-vn] [ -f pkgfile ] [pkgid ...]
8 while getopts :s:f:vn opt; do
10 f) pkgfile="$OPTARG" ;;
11 s) status="$OPTARG" ;;
16 shift $(( OPTIND - 1))
20 if [ -z "$pkgfile" ]; then
21 echo "must specify package file"
25 if [ $nameonly -eq 0 ]; then
31 if [ $verbose -eq 1 ]; then
32 cols="$cols,coalesce(status,'-')"
35 if [ -n "$status" ]; then
36 status=$(zpm quote "$status")
37 where="where status = '$status'"
42 if [ -n "$pkgid" ]; then
43 eval $(zpm parse -E "$pkgid")
44 if [ -n "$name" ]; then
45 package=$(zpm quote "$name")
46 where="$where and package = '$package'"
48 if [ -n "$version" ]; then
49 version=$(zpm quote "$version")
50 where="$where and version = '$version'"
52 if [ -n "$release" ]; then
53 release=$(zpm quote "$release")
54 where="$where and release = '$release'"
58 zpm shell $pkgfile <<EOS
60 select $cols from packages_pkgid $where