3 package=${1:-$ZPMPACKAGE}
5 pkgver=${ZPMPACKAGEVER:-1.0}
6 pkgrel=${ZPMPACKAGEREL:-1}
10 # option for "multipackage" just to let the system know that's what you meant
11 # option to take filenames from stdin
12 # parse package, version, release from file if not given
13 while getopts :f:v:r:d:a:u:l:p:b:P: opt; do
15 R) pkgroot="$OPTARG" ;;
17 f) pkgfile="$OPTARG" ;;
18 v) pkgver="$OPTARG" ;;
19 r) pkgrel="$OPTARG" ;;
20 d) description="$OPTARG" ;;
23 l) licenses="$OPTARG" ;;
24 p) packager="$OPTARG" ;;
25 b) builddate="$OPTARG" ;;
26 P) prefix="$OPTARG" ;;
31 if [ -z "$pkgfile" ]; then
32 pkgfile="$package-$pkgver-$pkgrel.zpm"
35 appid=$(sqlite3 $pkgfile 'pragma application_id;' | ( echo obase = 16; cat - ) | bc)
36 if [ "$appid" != "5A504442" ]; then
37 echo $pkgfile does not appear to be a zpm package file
42 sqlite3 $pkgfile <<EOS
44 select * from packages where package = '$package' and version = '$pkgver' and release = $pkgrel
47 } | sed -e 's/ = /=/' -e 's/^ \+//'