From 79987c92cb07c67914adf1febcc5ebdecf2a09b7 Mon Sep 17 00:00:00 2001 From: Xavier Chantry Date: Wed, 14 Oct 2009 20:07:28 +0200 Subject: makepkg -g: use checksums defined in the pkgbuild Signed-off-by: Xavier Chantry [Allan: amend documentation] Signed-off-by: Allan McRae Signed-off-by: Dan McGee --- scripts/makepkg.sh.in | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 7e99062b..dbb1a1e7 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -497,6 +497,24 @@ download_sources() { popd &>/dev/null } +get_integlist() { + local integ + local integlist=() + + for integ in md5 sha1 sha256 sha384 sha512; do + local integrity_sums=($(eval echo "\${${integ}sums[@]}")) + if [[ -n "$integrity_sums" ]]; then + integlist=(${integlist[@]} $integ) + fi + done + + if (( ${#integlist[@]} > 0 )); then + echo ${integlist[@]} + else + echo ${INTEGRITY_CHECK[@]} + fi +} + generate_checksums() { msg "$(gettext "Generating checksums for source files...")" plain "" @@ -506,8 +524,15 @@ generate_checksums() { exit 1 # $E_MISSING_PROGRAM fi + local integlist + if (( $# == 0 )); then + integlist=$(get_integlist) + else + integlist=$@ + fi + local integ - for integ in ${INTEGRITY_CHECK[@]}; do + for integ in ${integlist[@]}; do integ="${integ,,}" case "$integ" in md5|sha1|sha256|sha384|sha512) : ;; -- cgit v1.2.3-70-g09d2