-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