diff options
author | agc <agc@pkgsrc.org> | 1998-07-27 11:17:51 +0000 |
---|---|---|
committer | agc <agc@pkgsrc.org> | 1998-07-27 11:17:51 +0000 |
commit | 0d4ffda91d14958d0532b496fafa004034e9946f (patch) | |
tree | 864155151073d48a406c128005230104c8938f2d /mk | |
parent | fa93cccd937512fa24e2847339bb58d461fb5c68 (diff) | |
download | pkgsrc-0d4ffda91d14958d0532b496fafa004034e9946f.tar.gz |
Calculate an additional checksum when a distfile is fetched - if it
doesn't match the stored checksum, retrieve the distfile from the
next site in the list, rather than simply dying.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/bsd.pkg.mk | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index 053183fe02a..c344d9071da 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.mk,v 1.129 1998/07/26 22:20:22 tv Exp $ +# $NetBSD: bsd.pkg.mk,v 1.130 1998/07/27 11:17:51 agc Exp $ # # This file is in the public domain. # @@ -745,9 +745,19 @@ do-fetch: fi ; \ ${ECHO_MSG} ">> $$file doesn't seem to exist on this system."; \ for site in ${MASTER_SITES}; do \ - ${ECHO_MSG} ">> Attempting to fetch from $${site}."; \ + ${ECHO_MSG} ">> Attempting to fetch $$file from $${site}."; \ if ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} ${FETCH_AFTER_ARGS}; then \ - continue 2; \ + if [ -f ${MD5_FILE} ]; then \ + CKSUM=`${MD5} < ${DISTDIR}/$$file`; \ + CKSUM2=`${AWK} '$$1 == "MD5" && $$2 == "\('$$file'\)"{print $$4;}' ${MD5_FILE}`; \ + if [ "$$CKSUM" = "$$CKSUM2" -o "$$CKSUM2" = "IGNORE" ]; then \ + continue 2; \ + else \ + ${ECHO_MSG} ">> Checksum failure - trying next site."; \ + fi; \ + else \ + continue 2; \ + fi; \ fi \ done; \ ${ECHO_MSG} ">> Couldn't fetch it - please try to retrieve this";\ |