summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Sutter <phil.sutter@viprinet.com>2011-01-19 11:46:26 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2011-01-20 14:00:28 +0100
commit74d949cb06d5e071cd369ab89b1f09bd0e753ab9 (patch)
tree7e10974bbd00e25a365779f8847659b82c594775
parent801552c5a998dfd5859acdbab6db93d4e66eb550 (diff)
fetch.mk: support checksum checking of multiple distfiles
Signed-off-by: Phil Sutter <phil.sutter@viprinet.com>
-rw-r--r--mk/fetch.mk7
1 files changed, 5 insertions, 2 deletions
diff --git a/mk/fetch.mk b/mk/fetch.mk
index 2172e9d86..5c3edf918 100644
--- a/mk/fetch.mk
+++ b/mk/fetch.mk
@@ -33,18 +33,21 @@ ifeq ($(strip ${NO_CHECKSUM}),)
${_CHECKSUM_COOKIE}: ${FULLDISTFILES}
-rm -rf ${WRKDIR}
@OK=n; \
+ allsums="$(strip ${PKG_MD5SUM})"; \
(md5sum ${FULLDISTFILES}; echo exit) | while read sum name; do \
if [[ $$sum = exit ]]; then \
[[ $$OK = n ]] && echo >&2 "==> No distfile found!" || :; \
[[ $$OK = 1 ]] || exit 1; \
break; \
fi; \
- if [[ $$sum = "$(strip ${PKG_MD5SUM})" ]]; then \
+ cursum="$${allsums%% *}"; \
+ allsums="$${allsums#* }"; \
+ if [[ $$sum = "$$cursum" ]]; then \
[[ $$OK = 0 ]] || OK=1; \
continue; \
fi; \
echo >&2 "==> Checksum mismatch for $${name##*/} (MD5)"; \
- echo >&2 ":---> should be '$(strip ${PKG_MD5SUM})'"; \
+ echo >&2 ":---> should be '$$cursum'"; \
echo >&2 ":---> really is '$$sum'"; \
OK=0; \
done