From e3a06961f6363820f11112d18a62e6201d06a13a Mon Sep 17 00:00:00 2001 From: Aaron Schaefer Date: Tue, 13 Jan 2009 17:59:33 -0500 Subject: makepkg: use INTEGRITY_CHECK only for generation of checksums Signed-off-by: Aaron Schaefer [Dan: fail if checksum array is incorrectly sized] Signed-off-by: Dan McGee --- scripts/makepkg.sh.in | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index da7e71f3..baa9c57b 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -547,11 +547,13 @@ check_checksums() { exit 1 # $E_MISSING_PROGRAM fi + local correlation=0 local integ required for integ in md5 sha1 sha256 sha384 sha512; do local integrity_sums=($(eval echo "\${${integ}sums[@]}")) if [ ${#integrity_sums[@]} -eq ${#source[@]} ]; then msg "$(gettext "Validating source files with %s...")" "${integ}sums" + correlation=1 local errors=0 local idx=0 local file @@ -586,15 +588,15 @@ check_checksums() { exit 1 # TODO: error code fi else - for required in ${INTEGRITY_CHECK[@]}; do - required="$(echo $required | tr '[:upper:]' '[:lower:]')" - if [ "$integ" = "$required" ]; then - warning "$(gettext "Integrity checks (%s) are missing or incomplete.")" "$integ" - break - fi - done + error "$(gettext "Integrity checks (%s) differ in size from the source array.")" "$integ" + exit 1 # TODO: error code fi done + + if [ $correlation -eq 0 ]; then + error "$(gettext "Integrity checks are missing.")" + exit 1 # TODO: error code + fi } extract_sources() { -- cgit v1.2.3-70-g09d2