X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=zpm-pkginfo;fp=zpm-pkginfo;h=93326e50d1e6b27e7590d387f7f14ca527cab16d;hb=ecdd57da7df775c039aee834e1f74172004f352b;hp=0000000000000000000000000000000000000000;hpb=fa23ca4b77cd45ed4996eafc1fa714e12a72439e;p=zpackage diff --git a/zpm-pkginfo b/zpm-pkginfo new file mode 100755 index 0000000..93326e5 --- /dev/null +++ b/zpm-pkginfo @@ -0,0 +1,49 @@ +#!/bin/sh + +package=${1:-$ZPMPACKAGE} +shift +pkgver=${ZPMPACKAGEVER:-1.0} +pkgrel=${ZPMPACKAGEREL:-1} + +pkgroot=/ + +# option for "multipackage" just to let the system know that's what you meant +# option to take filenames from stdin +# parse package, version, release from file if not given +while getopts :f:v:r:d:a:u:l:p:b:P: opt; do + case $opt in + R) pkgroot="$OPTARG" ;; + S) format=shell ;; + f) pkgfile="$OPTARG" ;; + v) pkgver="$OPTARG" ;; + r) pkgrel="$OPTARG" ;; + d) description="$OPTARG" ;; + a) arch="$OPTARG" ;; + u) url="$OPTARG" ;; + l) licenses="$OPTARG" ;; + p) packager="$OPTARG" ;; + b) builddate="$OPTARG" ;; + P) prefix="$OPTARG" ;; + esac +done + +set -e +if [ -z "$pkgfile" ]; then + pkgfile="$package-$pkgver-$pkgrel.zpm" +fi + +appid=$(sqlite3 $pkgfile 'pragma application_id;' | ( echo obase = 16; cat - ) | bc) +if [ "$appid" != "5A504442" ]; then + echo $pkgfile does not appear to be a zpm package file + exit 1 +fi + +{ +sqlite3 $pkgfile <