X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;ds=sidebyside;f=zpm-newpackage;h=66044d942c2057f2ee34c1cbdc871b677cfbf9b7;hb=7cc581729bb4b242c803299f72eed987b9fee216;hp=7ab8aa8e5079f1028e8ef9df364a761f786b7e7c;hpb=40a2775ee3b08f365330b478ddceabc8b793f035;p=zpackage diff --git a/zpm-newpackage b/zpm-newpackage index 7ab8aa8..66044d9 100755 --- a/zpm-newpackage +++ b/zpm-newpackage @@ -5,9 +5,17 @@ pkgrel=${ZPMPKGREL:-1} builddate=$(date '+%s') -while getopts :f:v:r:d:a:u:l:p:b:I 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" ;; @@ -19,9 +27,19 @@ while getopts :f:v:r:d:a:u:l:p:b:I opt; do I) idempotent=1 esac done -shift $(( $OPTIND - 1)) +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" @@ -37,7 +55,7 @@ if [ "$idempotent" = 1 ]; then idempotent='or ignore' fi -sqlite3 $pkgfile <