From: Nathan Wagner Date: Sat, 16 Sep 2017 21:14:56 +0000 (-0500) Subject: check for non-regular file in zpm test X-Git-Tag: v0.1.6~121 X-Git-Url: https://pd.if.org/git/?p=zpackage;a=commitdiff_plain;h=6d070e7b1f4ae6e319c9a3a856d05d3de720c3bb check for non-regular file in zpm test This avoids creating an sqlite db automatically in the case the file doesn't exist. --- diff --git a/zpm-test b/zpm-test index da8ca6f..4ed9e85 100755 --- a/zpm-test +++ b/zpm-test @@ -13,6 +13,13 @@ done shift $((OPTIND - 1)) for pkgfile in "$@"; do + if [ ! -f "$pkgfile" ]; then + if [ "$verbose" -eq 1 ]; then + echo $pkgfile does not appear to be a zpm package file 1>&2 + fi + exit 1 + fi + appid=$(sqlite3 $pkgfile 'pragma application_id;' | ( echo obase = 16; cat - ) | bc) if [ "$appid" != "5A504442" ]; then if [ "$verbose" -eq 1 ]; then