-for path in $*; do
-hash=$(./zpm-addfile $pkgfile $path)
-
-sqlite3 $pkgfile <<EOS
-create table if not exists packagefiles (
- package text,
- subpackage text, -- libs, dev, client, server, whatever
- hash text,
- path text,
- filetype text -- e.g. config, etc?
-);
-insert into packagefiles
-values ('$package', nullif('$subpackage', ''), '$hash', '$path', NULL)
+pkg=$1
+shift
+#printf "pkg: %s\n" $pkg
+pkgid=$(zpm findpkg $pkgfile $pkg)
+
+#printf "pkgid: %s\n" $pkgid
+
+case $1 in
+ status) item=status ;;
+ *) printf 'no such field %s\n' $1; exit 1 ;;
+esac
+
+item=$1
+
+if [ -n "$2" ]; then
+ setting=$2
+zpm shell $pkgfile <<EOS
+update packages set $item = '$setting'
+where
+printf('%s-%s-%s', package,version,release) = '$pkgid'