]> pd.if.org Git - zpackage/blobdiff - zpm-test
fix status after dry run
[zpackage] / zpm-test
index 9f7471868b00e425357690bd75308e4bb264ea8a..97d3cd62935a056162d6bf70afff3b3119571937 100755 (executable)
--- 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 exist 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