index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2008-08-23 10:19:17 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2008-08-23 10:19:17 -0500 |
commit | 496b687c3d4a56641051700e7c4e5e21b9c6607c (patch) | |
tree | 6f98908527e382279054b39618b98d7d3f317ee6 /scripts/makepkg.sh.in | |
parent | baf58525553db8f1e680de16793b147c88df59e2 (diff) |
-rw-r--r-- | scripts/makepkg.sh.in | 38 |
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index d641cbb6..f6136ba6 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -463,6 +463,11 @@ generate_checksums() { msg "$(gettext "Generating checksums for source files...")" plain "" + if [ ! $(type -p openssl) ]; then + error "$(gettext "Cannot find openssl.")" + exit 1 # $E_MISSING_PROGRAM + fi + local integ for integ in ${INTEGRITY_CHECK[@]}; do integ="$(echo $integ | tr '[:upper:]' '[:lower:]')" @@ -473,11 +478,6 @@ generate_checksums() { exit 1;; # $E_CONFIG_ERROR esac - if [ ! $(type -p openssl) ]; then - error "$(gettext "Cannot find openssl.")" - exit 1 # $E_MISSING_PROGRAM - fi - local ct=0 local numsrc=${#source[@]} echo -n "${integ}sums=(" @@ -515,21 +515,13 @@ generate_checksums() { } check_checksums() { - local integ - for integ in ${INTEGRITY_CHECK[@]}; do - integ="$(echo $integ | tr '[:upper:]' '[:lower:]')" - case "$integ" in - md5|sha1|sha256|sha384|sha512) : ;; - *) - error "$(gettext "Invalid integrity algorithm '%s' specified")" "$integ" - exit 1;; # $E_CONFIG_ERROR - esac - - if [ ! $(type -p openssl) ]; then - error "$(gettext "Cannot find openssl.")" - exit 1 # $E_MISSING_PROGRAM - fi + if [ ! $(type -p openssl) ]; then + error "$(gettext "Cannot find openssl.")" + exit 1 # $E_MISSING_PROGRAM + fi + 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" @@ -567,7 +559,13 @@ check_checksums() { exit 1 # TODO: error code fi else - warning "$(gettext "Integrity checks (%s) are missing or incomplete.")" "$integ" + 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 fi done } |