diff options
author | Allan McRae <allan@archlinux.org> | 2012-06-04 02:33:52 +0200 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2012-08-03 16:16:38 +0200 |
commit | 57e06394dd19191f36880aa8d1d4522a458922ca (patch) | |
tree | 9437148f19fc34fb1fc9c6716879e1f7aac9b701 /scripts | |
parent | 1a04e2e11a012162b7b3b91e4c7a8c82dd113a94 (diff) | |
download | pacman-57e06394dd19191f36880aa8d1d4522a458922ca.tar.gz pacman-57e06394dd19191f36880aa8d1d4522a458922ca.tar.xz |
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>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/makepkg.sh.in | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 6bf95ff0..26466ab4 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -737,6 +737,12 @@ check_checksums() { file="$(get_filename "$file")" 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 printf -- "$(gettext "NOT FOUND")\n" >&2 errors=1 @@ -744,18 +750,14 @@ check_checksums() { fi if (( $found )) ; then - if [[ ${integrity_sums[$idx]} = 'SKIP' ]]; then - echo "$(gettext "Skipped")" >&2 + local expectedsum="${integrity_sums[idx],,}" + local realsum="$(openssl dgst -${integ} "$file")" + realsum="${realsum##* }" + if [[ $expectedsum = "$realsum" ]]; then + printf -- "$(gettext "Passed")\n" >&2 else - local expectedsum=$(tr '[:upper:]' '[:lower:]' <<< "${integrity_sums[$idx]}") - local realsum="$(openssl dgst -${integ} "$file")" - realsum="${realsum##* }" - if [[ $expectedsum = "$realsum" ]]; then - printf -- "$(gettext "Passed")\n" >&2 - else - printf -- "$(gettext "FAILED")\n" >&2 - errors=1 - fi + printf -- "$(gettext "FAILED")\n" >&2 + errors=1 fi fi |