From 6d070e7b1f4ae6e319c9a3a856d05d3de720c3bb Mon Sep 17 00:00:00 2001 From: Nathan Wagner Date: Sat, 16 Sep 2017 16:14:56 -0500 Subject: [PATCH] check for non-regular file in zpm test This avoids creating an sqlite db automatically in the case the file doesn't exist. --- zpm-test | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- 2.40.0