3 pkgfile=${ZPM_PACKAGE_FILE:-${ZPMDB:-/var/lib/zpm/local.db}}
7 # newpackage -f pkgfile $pkgid
8 while getopts :f:v opt; do
10 f) pkgfile="$OPTARG" ;;
14 shift $(( OPTIND - 1))
25 if [ ! -f "$pkgfile" ]; then
26 die $pkgfile does not exist
32 for pkgstr in "$@"; do
33 pkgid=$(zpm findpkg -f $pkgfile "$pkgstr")
34 if [ $verbose -gt 0 ]; then
35 if [ -z "$pkgid" ]; then
36 warn "$pkgstr not found"
39 if [ $verbose -gt 1 ]; then
40 warn "found %s -> %s\n" "$pkgstr", "$pkgid"
43 pkgid=$(zpm quote "$pkgid")
44 printf "delete from packages_pkgid where pkgid = '$pkgid';\n"
47 } | zpm shell $pkgfile