summaryrefslogtreecommitdiffstats
path: root/scripts/makepkg.sh.in
diff options
context:
space:
mode:
authorLoui Chang <louipc.ist@gmail.com>2009-04-07 06:15:45 +0200
committerDan McGee <dan@archlinux.org>2009-04-11 19:52:11 +0200
commit52d184dae82dbcfe265683dac04ff1c7b0e5be74 (patch)
tree2feaa5e6320c6c0d1d41e17977eb81ed9de311a8 /scripts/makepkg.sh.in
parent63fc93607b3fb9950f927d0533742f0e1fc37dd0 (diff)
downloadpacman-52d184dae82dbcfe265683dac04ff1c7b0e5be74.tar.gz
pacman-52d184dae82dbcfe265683dac04ff1c7b0e5be74.tar.xz
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>
Diffstat (limited to 'scripts/makepkg.sh.in')
-rw-r--r--scripts/makepkg.sh.in19
1 files changed, 11 insertions, 8 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 349d0e0e..9ff70f6e 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -573,6 +573,7 @@ check_checksums() {
local idx=0
local file
for file in "${source[@]}"; do
+ local found=1
file="$(get_filename "$file")"
echo -n " $file ... " >&2
@@ -580,19 +581,21 @@ check_checksums() {
if [ ! -f "$file" ] ; then
echo "$(gettext "NOT FOUND")" >&2
errors=1
- continue
+ found=0
else
file="$SRCDEST/$file"
fi
fi
- 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
- errors=1
+ if [ $found -gt 0 ] ; 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
+ errors=1
+ fi
fi
idx=$((idx + 1))