kiss: Drop sha256sum_sh for now
This commit is contained in:
parent
b415d18b9e
commit
29d019a56b
30
kiss
30
kiss
|
@ -56,7 +56,7 @@
|
||||||
# - unzip (optional)
|
# - unzip (optional)
|
||||||
# - lzma (optional)
|
# - lzma (optional)
|
||||||
# - lzip (optional)
|
# - lzip (optional)
|
||||||
# - sha256sum (checksums) (NO standard) (fallback openssl implementation)
|
# - sha256sum (checksums) (NO standard)
|
||||||
#
|
#
|
||||||
# Dylan Araps.
|
# Dylan Araps.
|
||||||
|
|
||||||
|
@ -148,22 +148,6 @@ decompress() {
|
||||||
esac < "$1"
|
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() {
|
pkg_lint() {
|
||||||
log "$1" "Checking repository files"
|
log "$1" "Checking repository files"
|
||||||
|
|
||||||
|
@ -608,7 +592,7 @@ pkg_etcsums() (
|
||||||
# prior directory before being able to continue.
|
# prior directory before being able to continue.
|
||||||
cd "$pkg_dir/$1/etc" 2>/dev/null || return 0; cd ..
|
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() (
|
pkg_tar() (
|
||||||
|
@ -804,7 +788,7 @@ pkg_checksums() {
|
||||||
|
|
||||||
# An easy way to get 'sha256sum' to print with the 'basename'
|
# An easy way to get 'sha256sum' to print with the 'basename'
|
||||||
# of files is to 'cd' to the file's directory beforehand.
|
# 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"
|
die "$1" "Failed to generate checksums"
|
||||||
done < "$(pkg_find "$1")/sources"
|
done < "$(pkg_find "$1")/sources"
|
||||||
}
|
}
|
||||||
|
@ -1043,8 +1027,8 @@ pkg_etc() {
|
||||||
|
|
||||||
# Handle files in /etc/ based on a 3-way checksum check.
|
# Handle files in /etc/ based on a 3-way checksum check.
|
||||||
find etc ! -type d | while read -r file; do
|
find etc ! -type d | while read -r file; do
|
||||||
{ sum_new=$("$sha256sum" "$file")
|
{ sum_new=$(sha256sum "$file")
|
||||||
sum_sys=$(cd "$KISS_ROOT/"; "$sha256sum" "$file")
|
sum_sys=$(cd "$KISS_ROOT/"; sha256sum "$file")
|
||||||
sum_old=$("$grep" "$file$" "$mak_dir/c"); } 2>/dev/null ||:
|
sum_old=$("$grep" "$file$" "$mak_dir/c"); } 2>/dev/null ||:
|
||||||
|
|
||||||
log "$pkg_name" "Doing 3-way handshake for $file"
|
log "$pkg_name" "Doing 3-way handshake for $file"
|
||||||
|
@ -1631,10 +1615,6 @@ main() {
|
||||||
# of the log files the package manager creates uring builds.
|
# of the log files the package manager creates uring builds.
|
||||||
time=$(date '+%Y-%m-%d-%H:%M')
|
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.
|
# Make note of the user's current ID to do root checks later on.
|
||||||
# This is used enough to warrant a place here.
|
# This is used enough to warrant a place here.
|
||||||
uid=$(id -u)
|
uid=$(id -u)
|
||||||
|
|
Loading…
Reference in New Issue