Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   ArchLinux Pacman Development (http://www.linux-archive.org/archlinux-pacman-development/)
-   -   makepkg: skip integrity checking early (http://www.linux-archive.org/archlinux-pacman-development/677541-makepkg-skip-integrity-checking-early.html)

Allan McRae 06-26-2012 10:58 PM

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

Signed-off-by: Allan McRae <allan@archlinux.org>
---
scripts/makepkg.sh.in | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 2a8866f..985bbbd 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -736,6 +736,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")
" >&2
errors=1
@@ -743,18 +749,14 @@ check_checksums() {
fi

if (( $found )) ; then
- if [[ ${integrity_sums[$idx]} = 'SKIP' ]]; then
- echo "$(gettext "Skipped")" >&2
+ local expectedsum=$(tr '[:upper:]' '[:lower:]' <<< "${integrity_sums[$idx]}")
+ local realsum="$(openssl dgst -${integ} "$file")"
+ realsum="${realsum##* }"
+ if [[ $expectedsum = "$realsum" ]]; then
+ printf -- "$(gettext "Passed")
" >&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")
" >&2
- else
- printf -- "$(gettext "FAILED")
" >&2
- errors=1
- fi
+ printf -- "$(gettext "FAILED")
" >&2
+ errors=1
fi
fi

--
1.7.11.1


All times are GMT. The time now is 05:07 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.