3 pkgver=${ZPMPKGVER:-1.0}
6 builddate=$(date '+%s')
8 # create a new package in: local, env, arg
9 # arg, then env, then local
11 # the repo given via ZPMDB
12 # the repo implied by the arguments
13 # the repo in /var/lib/zpm/local.db
15 while getopts :f:v:r:d:a:u:l:p:b:In: opt; do
17 f) pkgfile="$OPTARG" ;;
18 n) pkgname="$OPTARG" ;;
19 v) pkgver="$OPTARG" ;;
20 r) pkgrel="$OPTARG" ;;
21 d) description="$OPTARG" ;;
24 l) licenses="$OPTARG" ;;
25 p) packager="$OPTARG" ;;
26 b) builddate="$OPTARG" ;;
30 shift $(( OPTIND - 1))
40 if [ -z "$package" ]; then
41 die "must specify package"
44 if [ -z "$pkgfile" ]; then
45 pkgfile="$package-$pkgver-$pkgrel.zpm"
50 if [ ! -e $pkgfile ]; then
54 if [ "$idempotent" = 1 ]; then
55 idempotent='or ignore'
58 zpm shell $pkgfile <<EOS
59 insert $idempotent into packages ("package", "version", "release", "build_time")
60 values ('$package', '$pkgver', $pkgrel, $builddate)