X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=zpm-test;h=9f6c8767e0b1c6460804cd403a8c5a412bd6b9f5;hb=62e2d81f8e5c1a2284660752524753638ae59766;hp=9f7471868b00e425357690bd75308e4bb264ea8a;hpb=bd46218e36b09bc89497dd8aa5426d6610cd240c;p=zpackage diff --git a/zpm-test b/zpm-test index 9f74718..9f6c876 100755 --- a/zpm-test +++ b/zpm-test @@ -10,9 +10,17 @@ while getopts v opt; do v) verbose=1 ;; esac done +shift $((OPTIND - 1)) for pkgfile in "$@"; do -appid=$(sqlite3 $pkgfile 'pragma application_id;' | ( echo obase = 16; cat - ) | bc) + if [ ! -f "$pkgfile" ]; then + if [ "$verbose" -eq 1 ]; then + echo $pkgfile does not appear to be a zpm package file 1>&2 + fi + exit 1 + fi + +appid=$(zpm shell $pkgfile 'pragma application_id;' | ( echo obase = 16; cat - ) | bc) if [ "$appid" != "5A504442" ]; then if [ "$verbose" -eq 1 ]; then echo $pkgfile does not appear to be a zpm package file 1>&2