summaryrefslogtreecommitdiff
path: root/abuild.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-11-29 13:09:57 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2012-11-29 13:09:57 +0100
commit85cd8c961d30e08ac437c4338036b399ee57716e (patch)
treeb932af2e29bfca0ff8dc2a220e7fabc9622cfdee /abuild.in
parent630ec7268a6717c272e9e693f53f3f3733afcf1e (diff)
downloadabuild-85cd8c961d30e08ac437c4338036b399ee57716e.tar.gz
abuild-85cd8c961d30e08ac437c4338036b399ee57716e.tar.bz2
abuild-85cd8c961d30e08ac437c4338036b399ee57716e.tar.xz
abuild-85cd8c961d30e08ac437c4338036b399ee57716e.zip
abuild: improve sanitycheck to check sanity of all checksums
Diffstat (limited to 'abuild.in')
-rwxr-xr-xabuild.in16
1 files changed, 11 insertions, 5 deletions
diff --git a/abuild.in b/abuild.in
index ad48b6c..7658c03 100755
--- a/abuild.in
+++ b/abuild.in
@@ -190,18 +190,24 @@ default_sanitycheck() {
warning "You should not have \$install in source"
continue
fi
- md5sums_has ${i##*/} || die "${i##*/} is missing in md5sums"
+ list_has ${i##*/} $md5sums $sha256sums $sha512sums \
+ || die "${i##*/} is missing in checksums"
case "$i" in
https://*) makedepends_has wget && warning "wget no longer need to be in makedepends when source has https://" ;;
esac
done
fi
- if [ -n "$md5sums" ]; then
- for i in $(echo "$md5sums" | awk '{ print $2 }'); do
- source_has $i || die "$i exists in md5sums but is missing in source"
+ # verify that things listed in checksum also is listed in source
+ local algo=
+ for algo in md5 sha256 sha512; do
+ eval set -- \$${algo}sums
+ while [ $# -gt 1 ]; do
+ local file="$2"
+ shift 2
+ source_has $file || die "$file exists in ${algo}sums but is missing in source"
done
- fi
+ done
# common spelling errors
[ -n "$depend" ] && die "APKBUILD contains 'depend'. It should be depends"