diff options
author | rillig <rillig> | 2007-02-20 09:53:23 +0000 |
---|---|---|
committer | rillig <rillig> | 2007-02-20 09:53:23 +0000 |
commit | db9a17fdaa4541f7d5b95678d3aa213377f70001 (patch) | |
tree | ea526e0c807c6882c103d727e8628dd4a7e1dacc /mk/checksum | |
parent | 001f21694eafc0303d185a6b290045f694b8cbdc (diff) | |
download | pkgsrc-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.mk | 16 |
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"; \ |