diff options
author | Xavier Chantry <shiningxc@gmail.com> | 2008-08-22 13:54:15 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2008-08-23 08:37:19 -0500 |
commit | 901e4aa5c203f605e9d527e474821426a40e5cea (patch) | |
tree | bafb4ab31a4bf7ae74a11a27233124e77e48ba06 | |
parent | 282eeadc68fec1da8651d0c65ad0dfebd11a9c7f (diff) | |
download | pacman-901e4aa5c203f605e9d527e474821426a40e5cea.tar.xz |
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 <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r-- | scripts/makepkg.sh.in | 4 |
1 files changed, 3 insertions, 1 deletions
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 |