X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=zpm-newpackage;h=66044d942c2057f2ee34c1cbdc871b677cfbf9b7;hb=7cc581729bb4b242c803299f72eed987b9fee216;hp=2b947015c47e60d852aedd432edb2d480fbe6ff4;hpb=cd99bcfaa954c059bbae5fcaf89117fb493d91c7;p=zpackage diff --git a/zpm-newpackage b/zpm-newpackage index 2b94701..66044d9 100755 --- a/zpm-newpackage +++ b/zpm-newpackage @@ -1,14 +1,21 @@ #!/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 +# create a new package in: local, env, arg +# arg, then env, then local + +# the repo given via ZPMDB +# the repo implied by the arguments +# the repo in /var/lib/zpm/local.db + +while getopts :f:v:r:d:a:u:l:p:b:In: opt; do case $opt in f) pkgfile="$OPTARG" ;; + n) pkgname="$OPTARG" ;; v) pkgver="$OPTARG" ;; r) pkgrel="$OPTARG" ;; d) description="$OPTARG" ;; @@ -17,8 +24,22 @@ 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)) + +die() { + echo $* 1>&2 + exit 1 +} + +package=$1 +shift + +if [ -z "$package" ]; then + die "must specify package" +fi if [ -z "$pkgfile" ]; then pkgfile="$package-$pkgver-$pkgrel.zpm" @@ -30,8 +51,12 @@ if [ ! -e $pkgfile ]; then zpm init $pkgfile fi -sqlite3 $pkgfile <