From 901e4aa5c203f605e9d527e474821426a40e5cea Mon Sep 17 00:00:00 2001 From: Xavier Chantry Date: Fri, 22 Aug 2008 13:54:15 +0200 Subject: makepkg: do insensitive comparisons of checksums. This fixes FS#11283 , which was originally reported on the forums : http://bbs.archlinux.org/viewtopic.php?id=53794 Insensitive comparisons were implicitly made before since md5sum --status was used for checking. Now that we use openssl and compare checksums manually in bash, we lost that feature. This can be easily reintroduced using tr '[A-F]' '[a-f]' What convinced me to fix it is that the md5 command line tool generates md5sums in upper case by default : http://www.fourmilab.ch/md5/ And finally, A-F and a-f are the same in hex and both are used. Signed-off-by: Xavier Chantry Signed-off-by: Dan McGee --- scripts/makepkg.sh.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index b230b786..77e61a0b 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -550,7 +550,9 @@ check_checksums() { fi fi - if [ "${integrity_sums[$idx]}" = "$(openssl dgst -${integ} "$file" | awk '{print $NF}')" ]; then + local expectedsum="$(echo ${integrity_sums[$idx]} | tr '[A-F]' '[a-f]')" + local realsum="$(openssl dgst -${integ} "$file" | awk '{print $NF}')" + if [ "$expectedsum" = "$realsum" ]; then echo "$(gettext "Passed")" >&2 else echo "$(gettext "FAILED")" >&2 -- cgit v1.2.3-70-g09d2