#!/bin/sh
-package=${1:-$ZPMPACKAGE}
-shift
pkgver=${ZPMPKGVER:-1.0}
pkgrel=${ZPMPKGREL:-1}
c) tags="$tags +configuration" ;;
esac
done
+shift $((OPTIND - 1))
+
+package="$1"
+shift
set -e
if [ -z "$pkgfile" ]; then
if [ ! -f $pkgfile ]; then
zpm newpackage $package || exit 1
else
- zpm-test -v $pkgfile
+ zpm test -v $pkgfile
fi
for path in $*; do
#!/bin/sh
-package=${1:-$ZPMPACKAGE}
pkgver=${ZPMPKGVER:-1.0}
pkgrel=${ZPMPKGREL:-1}
builddate=$(date '+%s')
-while getopts :f:v:r:d:a:u:l:p:b: opt; do
+while getopts :f:v:r:d:a:u:l:p:b:I opt; do
case $opt in
f) pkgfile="$OPTARG" ;;
v) pkgver="$OPTARG" ;;
l) licenses="$OPTARG" ;;
p) packager="$OPTARG" ;;
b) builddate="$OPTARG" ;;
+ I) idempotent=1
esac
done
+shift $(( $OPTIND - 1))
+
+package=$1
if [ -z "$pkgfile" ]; then
pkgfile="$package-$pkgver-$pkgrel.zpm"
zpm init $pkgfile
fi
+if [ "$idempotent" = 1 ]; then
+ idempotent='or ignore'
+fi
+
sqlite3 $pkgfile <<EOS
-insert or ignore into packages ("package", "version", "release", "build_time")
+insert $idempotent into packages ("package", "version", "release", "build_time")
values ('$package', '$pkgver', $pkgrel, $builddate)
;
EOS