makepkg: skip integrity checking early

If "SKIP" is provided for an integrity check, abort checking as soon
as possible.

Also swap fork to tr for bash4 conversion.

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Allan McRae 2012-06-04 10:33:52 +10:00
parent 1a04e2e11a
commit 57e06394dd

View file

@ -737,6 +737,12 @@ check_checksums() {
file="$(get_filename "$file")" file="$(get_filename "$file")"
printf "%s" " $file ... " >&2 printf "%s" " $file ... " >&2
if [[ ${integrity_sums[$idx]} = 'SKIP' ]]; then
echo "$(gettext "Skipped")" >&2
idx=$((idx + 1))
continue
fi
if ! file="$(get_filepath "$file")"; then if ! file="$(get_filepath "$file")"; then
printf -- "$(gettext "NOT FOUND")\n" >&2 printf -- "$(gettext "NOT FOUND")\n" >&2
errors=1 errors=1
@ -744,10 +750,7 @@ check_checksums() {
fi fi
if (( $found )) ; then if (( $found )) ; then
if [[ ${integrity_sums[$idx]} = 'SKIP' ]]; then local expectedsum="${integrity_sums[idx],,}"
echo "$(gettext "Skipped")" >&2
else
local expectedsum=$(tr '[:upper:]' '[:lower:]' <<< "${integrity_sums[$idx]}")
local realsum="$(openssl dgst -${integ} "$file")" local realsum="$(openssl dgst -${integ} "$file")"
realsum="${realsum##* }" realsum="${realsum##* }"
if [[ $expectedsum = "$realsum" ]]; then if [[ $expectedsum = "$realsum" ]]; then
@ -757,7 +760,6 @@ check_checksums() {
errors=1 errors=1
fi fi
fi fi
fi
idx=$((idx + 1)) idx=$((idx + 1))
done done