From 9e36264f2824836422ca8895c571260b321b427c Mon Sep 17 00:00:00 2001 From: SMLinux Date: Fri, 28 Jan 2022 23:58:53 +0530 Subject: [PATCH] Moved verify function as a separate file and renamed it to verifychecksums --- bldpkg | 4 ++-- bldpkg.d/verifychecksums | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100755 bldpkg.d/verifychecksums diff --git a/bldpkg b/bldpkg index e50332c..59c4524 100755 --- a/bldpkg +++ b/bldpkg @@ -12,7 +12,7 @@ SRCDIR="$PWD" SRCDIRRPATH="$(basename $SRCDIR)" # verify checksums -verify() { +verifychecksums() { if [ -z "$SHA512SUMS" ] ; then echo "sha512 checksums don't exist in $SRCDIRRPATH.SMBuild !" echo "Please run bldpkg genchecksum" @@ -303,7 +303,7 @@ fi # source $1 #fi -verify +verifychecksums #build 2>&1 | tee -a "$APP".SMBuild.log.txt build diff --git a/bldpkg.d/verifychecksums b/bldpkg.d/verifychecksums new file mode 100755 index 0000000..f001b6f --- /dev/null +++ b/bldpkg.d/verifychecksums @@ -0,0 +1,19 @@ +# verify checksums +verifychecksums() { + if [ -z "$SHA512SUMS" ] ; then + echo "sha512 checksums don't exist in $SRCDIRRPATH.SMBuild !" + echo "Please run bldpkg genchecksum" + exit 1 + fi + + eval sums=\"\$SHA512SUMS\" + + echo "Verifying Checksums..." + IFS=$'\n' + for src in $sums; do + echo "$src" | sha512sum -c + done + unset IFS + echo "Looks good..." +} +