3 builddate=$(date '+%s')
5 # the repo implied by the arguments
9 while getopts :Cf:v:r:d:a:u:l:p:b:In: opt; do
11 f) pkgfile="$OPTARG" ;;
12 d) description="$OPTARG" ;;
15 l) licenses="$OPTARG" ;;
17 p) packager="$OPTARG" ;;
18 b) builddate="$OPTARG" ;;
22 shift $(( OPTIND - 1))
32 if [ -z "$pkgid" ]; then
33 die "must specify pkgid"
36 eval "$(zpm parse -E $pkgid)"
38 if [ -z "$release" ]; then
39 die 'must specify full package id'
42 if [ -z "$pkgfile" ]; then
43 pkgfile=$ZPM_PACKAGE_FILE
46 if [ -z "$pkgfile" ]; then
52 if [ ! -e $pkgfile ]; then
53 if [ $create -eq 1 ]; then
56 die "$pkgfile does not exist"
60 if [ "$idempotent" = 1 ]; then
61 idempotent='or ignore'
64 package=$(zpm quote "$name")
65 pkgver=$(zpm quote "$version")
66 pkgrel=$(zpm quote "$release")
68 zpm shell $pkgfile <<EOS
69 insert $idempotent into packages ("package", "version", "release", "build_time")
70 values ('$package', '$pkgver', $pkgrel, $builddate)