X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=zpm-newpackage;h=7ab8aa8e5079f1028e8ef9df364a761f786b7e7c;hb=40a2775ee3b08f365330b478ddceabc8b793f035;hp=2b947015c47e60d852aedd432edb2d480fbe6ff4;hpb=9daff10c7cf0cf1b983fca4a90065611ad0d3bf9;p=zpackage diff --git a/zpm-newpackage b/zpm-newpackage index 2b94701..7ab8aa8 100755 --- a/zpm-newpackage +++ b/zpm-newpackage @@ -1,12 +1,11 @@ #!/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" ;; @@ -17,8 +16,12 @@ while getopts :f:v:r:d:a:u:l:p:b: opt; do 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" @@ -30,8 +33,12 @@ if [ ! -e $pkgfile ]; then zpm init $pkgfile fi +if [ "$idempotent" = 1 ]; then + idempotent='or ignore' +fi + sqlite3 $pkgfile <