abuild: drop support for md5 and sha1 checksums

This commit is contained in:
Sertonix 2024-06-09 15:16:30 +02:00 committed by Natanael Copa
parent bf66ab6312
commit ae059fd558
3 changed files with 12 additions and 23 deletions

View File

@ -272,7 +272,7 @@ default_sanitycheck() {
*::*) i=${i%%::*};;
https://*) makedepends_has wget && warning "wget no longer need to be in makedepends when source has https://" ;;
esac
list_has ${i##*/} $md5sums $sha256sums $sha512sums \
list_has ${i##*/} $sha256sums $sha512sums \
|| die "${i##*/} is missing in checksums"
# verify that our source does not have git tag version
@ -288,7 +288,7 @@ default_sanitycheck() {
# verify that things listed in checksum also is listed in source
local algo=
for algo in md5 sha256 sha512; do
for algo in sha256 sha512; do
eval set -- \$${algo}sums
while [ $# -gt 1 ]; do
local file="$2"
@ -368,16 +368,10 @@ sumcheck() {
return $endreturnval
}
# for compatibility
md5check() {
warning "'md5check' is deprecated. Use 'verify' instead"
sumcheck md5 "$md5sums"
}
# verify checksums
verify() {
local verified=false algo=
for algo in sha512 sha256 sha1 md5; do
for algo in sha512 sha256; do
local sums=
eval sums=\"\$${algo}sums\"
if [ -z "$sums" ] || [ -z "$source" ]; then
@ -2392,17 +2386,17 @@ builddeps() {
deps || return 1
}
# replace the md5sums in the APKBUILD
# replace the sha512sums in the APKBUILD
checksum() {
local s files
[ -z "$source" ] && [ -n "${md5sums}${sha256sums}${sha512sums}" ] \
[ -z "$source" ] && [ -n "${sha256sums}${sha512sums}" ] \
&& msg "Removing checksums from $APKBUILD"
sed -E -i \
-e '/^(md5|sha[0-9]+)sums=".*"$/d' \
-e '/^(md5|sha[0-9]+)sums="/,/"$/d' \
-e '/^sha[0-9]+sums=".*"$/d' \
-e '/^sha[0-9]+sums="/,/"$/d' \
\
-e "/^(md5|sha[0-9]+)sums='.*'\$/d" \
-e "/^(md5|sha[0-9]+)sums='/,/'\$/d" \
-e "/^sha[0-9]+sums='.*'\$/d" \
-e "/^sha[0-9]+sums='/,/'\$/d" \
"$APKBUILD"
[ -z "$source" ] && return 0
@ -2416,7 +2410,6 @@ checksum() {
done
msg "Updating the sha512sums in $APKBUILD..."
md5sums=
sha256sums=
sha512sums="$(cd "$srcdir" && sha512sum $files)" \
|| die "sha512sum failed"
@ -2681,10 +2674,6 @@ makedepends_has() {
deplist_has "$1" $makedepends
}
md5sums_has() {
list_has "$1" $md5sums
}
install_has() {
list_has "$1" $install
}

View File

@ -50,4 +50,4 @@ check() {
# make check
}
md5sums="" #generate with 'abuild checksum'
sha512sums="" #generate with 'abuild checksum'

View File

@ -261,12 +261,12 @@ abuild_reproducible_body() {
pkgs=$(abuild listpkg)
abuild || atf_fail "first build failed"
checksums=$(cd "$REPODEST"/testrepo/$arch && md5sum $pkgs)
checksums=$(cd "$REPODEST"/testrepo/$arch && sha512sum $pkgs)
echo "$checksums"
rm -r "$REPODEST"/testrepo
abuild || atf_fail "rebuild failed"
checksums2=$(cd "$REPODEST"/testrepo/$arch && md5sum $pkgs)
checksums2=$(cd "$REPODEST"/testrepo/$arch && sha512sum $pkgs)
echo "$checksums2"
if [ "$checksums" != "$checksums2" ]; then