]> pd.if.org Git - zpackage/blob - bin/zpm-test
remove stray debug fprintf
[zpackage] / bin / zpm-test
1 #!/bin/sh
2
3 # tests a package file
4
5 # just checks that all args are valid pkg files
6 verbose=0
7
8 while getopts v opt; do
9         case $opt in
10                 v) verbose=1 ;;
11         esac
12 done
13 shift $((OPTIND - 1))
14
15 for pkgfile in "$@"; do
16         if [ ! -f "$pkgfile" ]; then
17                 if [ "$verbose" -eq 1 ]; then
18                         echo $pkgfile does not exist 1>&2
19                 fi
20                 exit 1
21         fi
22
23 # 0x5A504442 == 1515209794
24 appid=$(zpm shell $pkgfile 'pragma application_id;')
25 if [ "$appid" != "1515209794" ]; then
26         if [ "$verbose" -eq 1 ]; then
27                 echo $pkgfile does not appear to be a zpm package file 1>&2
28         fi
29         exit 1
30 fi
31 done
32
33 exit 0