From db9a17fdaa4541f7d5b95678d3aa213377f70001 Mon Sep 17 00:00:00 2001 From: rillig Date: Tue, 20 Feb 2007 09:53:23 +0000 Subject: 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. --- mk/checksum/checksum.mk | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'mk/checksum') 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"; \ -- cgit v1.2.3