summaryrefslogtreecommitdiff
path: root/mk/checksum
diff options
context:
space:
mode:
authorrillig <rillig>2007-02-20 09:53:23 +0000
committerrillig <rillig>2007-02-20 09:53:23 +0000
commitdb9a17fdaa4541f7d5b95678d3aa213377f70001 (patch)
treeea526e0c807c6882c103d727e8628dd4a7e1dacc /mk/checksum
parent001f21694eafc0303d185a6b290045f694b8cbdc (diff)
downloadpkgsrc-db9a17fdaa4541f7d5b95678d3aa213377f70001.tar.gz
For all but a very few developers, it is sufficient to check the
distfiles' checksums once and only once, between fetching and extracting them. The DO_CHECKSUMS_REPEATEDLY variable can be set to "yes" by those who need the checksums checked more than once.
Diffstat (limited to 'mk/checksum')
-rw-r--r--mk/checksum/checksum.mk16
1 files changed, 13 insertions, 3 deletions
diff --git a/mk/checksum/checksum.mk b/mk/checksum/checksum.mk
index c215afd9ba4..d2185605b29 100644
--- a/mk/checksum/checksum.mk
+++ b/mk/checksum/checksum.mk
@@ -1,8 +1,12 @@
-# $NetBSD: checksum.mk,v 1.2 2006/07/13 18:40:33 jlam Exp $
+# $NetBSD: checksum.mk,v 1.3 2007/02/20 09:53:23 rillig Exp $
_DIGEST_ALGORITHMS?= SHA1 RMD160
_PATCH_DIGEST_ALGORITHMS?= SHA1
+# Some developers want to check the distfiles' checksums every time
+# a public make target is called. They may set this variable to "yes".
+DO_CHECKSUM_REPEATEDLY?= no
+
# These variables are set by pkgsrc/mk/fetch/fetch.mk.
#_CKSUMFILES?= # empty
#_IGNOREFILES?= # empty
@@ -18,14 +22,20 @@ _CHECKSUM_CMD= \
ECHO=${TOOLS_ECHO:Q} TEST=${TOOLS_TEST:Q} \
${SH} ${PKGSRCDIR}/mk/checksum/checksum \
+_COOKIE.checksum= ${WRKDIR}/.checksum_done
+
.PHONY: checksum
.if !target(checksum)
-checksum: fetch
+checksum: fetch ${_COOKIE.checksum}
+${_COOKIE.checksum}:
. for _alg_ in ${_DIGEST_ALGORITHMS}
${_PKG_SILENT}${_PKG_DEBUG} \
if cd ${DISTDIR} && ${_CHECKSUM_CMD} -a ${_alg_:Q} \
${DISTINFO_FILE} ${_CKSUMFILES}; then \
- ${TRUE}; \
+ if [ ${DO_CHECKSUM_REPEATEDLY} = no ]; then \
+ ${MKDIR} ${.TARGET:H}; \
+ ${ECHO} ${PKGNAME} > ${.TARGET}; \
+ fi; \
else \
${ERROR_MSG} "Make sure the Makefile and checksum file (${DISTINFO_FILE})"; \
${ERROR_MSG} "are up to date. If you want to override this check, type"; \