done
shift $(( OPTIND - 1))
-: ${pkgfile:=$ZPMDB}
+: ${pkgfile:=${ZPMDB:-/var/lib/zpm/local.db}}
if [ -z "$pkgfile" ]; then
echo "must specify package file"
exit 1
fi
-if [ -n "$status" ]; then
- status=$(zpm quote "$status")
-fi
-
if [ $nameonly -eq 0 ]; then
cols="pkgid"
else
fi
if [ -n "$status" ]; then
+ status=$(zpm quote "$status")
where="where status = '$status'"
fi
if [ -n "$pkgid" ]; then
eval $(zpm parse -E "$pkgid")
- if [ -n "$package" ]; then
- package=$(zpm quote "$package")
+ if [ -n "$name" ]; then
+ package=$(zpm quote "$name")
where="$where and package = '$package'"
fi
if [ -n "$version" ]; then
select $cols from packages_pkgid $where
;
EOS
-