X-Git-Url: https://pd.if.org/git/?p=zpackage;a=blobdiff_plain;f=zpm-test;h=860a5d1de31a6335f3e014285d3b560ae4b53f60;hp=9f7471868b00e425357690bd75308e4bb264ea8a;hb=09c80a1f8918d888063f4d1a75921a99fe5f0b5c;hpb=bd46218e36b09bc89497dd8aa5426d6610cd240c diff --git a/zpm-test b/zpm-test index 9f74718..860a5d1 100755 --- a/zpm-test +++ b/zpm-test @@ -10,10 +10,19 @@ 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 [ "$appid" != "5A504442" ]; then + if [ ! -f "$pkgfile" ]; then + if [ "$verbose" -eq 1 ]; then + echo $pkgfile does not exist 1>&2 + fi + exit 1 + fi + +# 0x5A504442 == 1515209794 +appid=$(zpm shell $pkgfile 'pragma application_id;') +if [ "$appid" != "1515209794" ]; then if [ "$verbose" -eq 1 ]; then echo $pkgfile does not appear to be a zpm package file 1>&2 fi