From 29d019a56b679c8cf84ca1ba6db35c6b55ed1943 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 9 May 2020 19:05:23 +0300 Subject: [PATCH] kiss: Drop sha256sum_sh for now --- kiss | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/kiss b/kiss index 1e16778..d058d84 100755 --- a/kiss +++ b/kiss @@ -56,7 +56,7 @@ # - unzip (optional) # - lzma (optional) # - lzip (optional) -# - sha256sum (checksums) (NO standard) (fallback openssl implementation) +# - sha256sum (checksums) (NO standard) # # Dylan Araps. @@ -148,22 +148,6 @@ decompress() { esac < "$1" } -sha256sum_sh() { - # This is an implementation of 'sha256sum' using openssl/libressl. - # The checksums are merely extracted from the output and reformatted - # to match that of 'sha256sum'. - # - # This _only_ runs when the 'sha256sum' command is _not_ available - # in the host machine. It's a fallback. - [ -f "$1" ] || return - - IFS='= ' read -r _ _sum </dev/null || return 0; cd .. - find etc -type f -exec "$sha256sum" {} + > "$pkg_dir/$1/$pkg_db/$1/etcsums" + find etc -type f -exec sha256sum {} + > "$pkg_dir/$1/$pkg_db/$1/etcsums" ) pkg_tar() ( @@ -804,7 +788,7 @@ pkg_checksums() { # An easy way to get 'sha256sum' to print with the 'basename' # of files is to 'cd' to the file's directory beforehand. - (cd "$src_path" && "$sha256sum" "${src##*/}") || + (cd "$src_path" && sha256sum "${src##*/}") || die "$1" "Failed to generate checksums" done < "$(pkg_find "$1")/sources" } @@ -1043,8 +1027,8 @@ pkg_etc() { # Handle files in /etc/ based on a 3-way checksum check. find etc ! -type d | while read -r file; do - { sum_new=$("$sha256sum" "$file") - sum_sys=$(cd "$KISS_ROOT/"; "$sha256sum" "$file") + { sum_new=$(sha256sum "$file") + sum_sys=$(cd "$KISS_ROOT/"; sha256sum "$file") sum_old=$("$grep" "$file$" "$mak_dir/c"); } 2>/dev/null ||: log "$pkg_name" "Doing 3-way handshake for $file" @@ -1631,10 +1615,6 @@ main() { # of the log files the package manager creates uring builds. time=$(date '+%Y-%m-%d-%H:%M') - # Check to see if the sha256sum command exists in the system. If it does - # not, fallback to using openssl. - sha256sum=$(command -v sha256sum) || sha256sum=sha256sum_sh - # Make note of the user's current ID to do root checks later on. # This is used enough to warrant a place here. uid=$(id -u)