3 # edit package metadata
5 package=${1:-$ZPMPACKAGE}
6 pkgver=${ZPMPKGVER:-1.0}
9 #zpm pkg -s packager=foo zpm
11 # zpm pkg -f <pkgfile> zpm packager=xyz
12 # zpm pkg zpm packager zyz
13 # zpm pkg zpm packager
16 pkgfile=${ZPMDB:-/var/lib/zpm/db.zpm}
18 while getopts f: opt; do
20 f) pkgfile="$OPTARG" ;;
27 if [ ! -f $pkgfile ]; then
28 echo cannot find $pkgfile
34 #printf "pkg: %s\n" $pkg
35 pkgid=$(zpm findpkg $pkgfile $pkg)
37 #printf "pkgid: %s\n" $pkgid
40 status) item=status ;;
41 *) printf 'no such field %s\n' $1; exit 1 ;;
48 zpm shell $pkgfile <<EOS
49 update packages set $item = '$setting'
51 printf('%s-%s-%s', package,version,release) = '$pkgid'
55 setting=$(zpm shell $pkgfile <<EOS
56 select $item from packages
58 printf('%s-%s-%s', package,version,release) = '$pkgid'
62 if [ -n "$setting" ]; then
63 printf '%s\n' "$setting"