--- /dev/null
+#!/bin/sh
+
+# tests a package file
+
+# just checks that all args are valid pkg files
+verbose=0
+
+while getopts v opt; do
+ case $opt in
+ v) verbose=1 ;;
+ esac
+done
+shift $((OPTIND - 1))
+
+for pkgfile in "$@"; do
+ 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
+ exit 1
+fi
+done
+
+exit 0