From 1286051d5a1a79be795185117ec9cdc7ea868f82 Mon Sep 17 00:00:00 2001 From: Thomas Penteker Date: Sat, 2 Apr 2016 23:11:47 +0200 Subject: implement proper fallback with/without PKGMK_IGNORE_MD5SUM and PKGMK_IGNORE_SIGNATURE --- pkgmk.in | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkgmk.in b/pkgmk.in index f24d57d4..e4e3798d 100755 --- a/pkgmk.in +++ b/pkgmk.in @@ -292,6 +292,12 @@ check_signature() { local RESULT=0 local PUBKEY="" + # fall back to m5sums if no signature is available + if [ ! -e "$PKGMK_ROOT/$PKGMK_SIGNATURE" ] && [ "$PKGMK_IGNORE_MD5SUM" = "no" ]; then + warning "Falling back to old md5sum checking." + return 0; + fi + cd $PKGMK_ROOT if [ -f $PKGMK_SIGNATURE ]; then @@ -501,13 +507,13 @@ make_work_dir() { remove_work_dir mkdir -p $SRC $PKG - if [ "$PKGMK_IGNORE_MD5SUM" = "no" ]; then - check_md5sum - fi if [ "$PKGMK_IGNORE_SIGNATURE" = "no" ]; then test -f $PKGMK_SIGNATURE && cp $PKGMK_SIGNATURE $PKGMK_WORK_DIR check_signature fi + if [ "$PKGMK_IGNORE_MD5SUM" = "no" ]; then + check_md5sum + fi } remove_work_dir() { -- cgit v1.2.3