kiss: Drop sha256sum_sh for now

This commit is contained in:
Dylan Araps 2020-05-09 19:05:23 +03:00
parent b415d18b9e
commit 29d019a56b
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
1 changed files with 5 additions and 25 deletions

30
kiss
View File

@ -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 <<EOF
$(openssl dgst -sha256 "$1")
EOF
printf '%s %s\n' "$_sum" "$1"
}
pkg_lint() {
log "$1" "Checking repository files"
@ -608,7 +592,7 @@ pkg_etcsums() (
# prior directory before being able to continue.
cd "$pkg_dir/$1/etc" 2>/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)