1
0
mirror of https://github.com/moparisthebest/pacman synced 2025-01-09 13:07:58 -05:00

makepkg: Fix integrity check when files are missing.

The index in the for loop wasn't being incremented, so
if the first file wasn't found, the second file would be compared to the
first checksum, rather than the second.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Loui Chang 2009-04-07 00:15:45 -04:00 committed by Dan McGee
parent 63fc93607b
commit 52d184dae8

View File

@ -573,6 +573,7 @@ check_checksums() {
local idx=0 local idx=0
local file local file
for file in "${source[@]}"; do for file in "${source[@]}"; do
local found=1
file="$(get_filename "$file")" file="$(get_filename "$file")"
echo -n " $file ... " >&2 echo -n " $file ... " >&2
@ -580,12 +581,13 @@ check_checksums() {
if [ ! -f "$file" ] ; then if [ ! -f "$file" ] ; then
echo "$(gettext "NOT FOUND")" >&2 echo "$(gettext "NOT FOUND")" >&2
errors=1 errors=1
continue found=0
else else
file="$SRCDEST/$file" file="$SRCDEST/$file"
fi fi
fi fi
if [ $found -gt 0 ] ; then
local expectedsum="$(echo ${integrity_sums[$idx]} | tr '[A-F]' '[a-f]')" local expectedsum="$(echo ${integrity_sums[$idx]} | tr '[A-F]' '[a-f]')"
local realsum="$(openssl dgst -${integ} "$file" | awk '{print $NF}')" local realsum="$(openssl dgst -${integ} "$file" | awk '{print $NF}')"
if [ "$expectedsum" = "$realsum" ]; then if [ "$expectedsum" = "$realsum" ]; then
@ -594,6 +596,7 @@ check_checksums() {
echo "$(gettext "FAILED")" >&2 echo "$(gettext "FAILED")" >&2
errors=1 errors=1
fi fi
fi
idx=$((idx + 1)) idx=$((idx + 1))
done done