summaryrefslogtreecommitdiff
path: root/mk/checksum
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2007-08-24 03:11:01 +0000
committerjlam <jlam@pkgsrc.org>2007-08-24 03:11:01 +0000
commit9a59593e3edd0b55c67f685fdf514eb84ab6892c (patch)
tree7dcdea07edc3b8b21352e8e5ca0fadc4d79a80d2 /mk/checksum
parent52836927dca4a7a78df26a3b99df1c04ec034d50 (diff)
downloadpkgsrc-9a59593e3edd0b55c67f685fdf514eb84ab6892c.tar.gz
Restore the tradition behaviour of the "checksum" target. It can be
run now at any time up until the "extract" phase completes, and the "checksum" target no longer keeps a state (cookie) file. From the checksum.mk file comments: We do not actually wish to create a cookie file for the completion of the checksum phase because we want to be able to detect if any of the files have changed right up until the distfiles are extracted. Therefore, we use the presence of the cookie file from the "extract" phase to determine whether we need to continue to verify checksums. This addresses PR pkg/36262 and PR pkg/36603.
Diffstat (limited to 'mk/checksum')
-rw-r--r--mk/checksum/checksum.mk35
1 files changed, 21 insertions, 14 deletions
diff --git a/mk/checksum/checksum.mk b/mk/checksum/checksum.mk
index c08f705c497..d4752141146 100644
--- a/mk/checksum/checksum.mk
+++ b/mk/checksum/checksum.mk
@@ -1,4 +1,4 @@
-# $NetBSD: checksum.mk,v 1.7 2007/08/16 16:29:27 jlam Exp $
+# $NetBSD: checksum.mk,v 1.8 2007/08/24 03:11:01 jlam Exp $
#
# See bsd.checksum.mk for helpful comments.
#
@@ -6,10 +6,6 @@
_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
@@ -20,19 +16,30 @@ _CHECKSUM_CMD= \
TEST=${TOOLS_TEST:Q} \
${SH} ${PKGSRCDIR}/mk/checksum/checksum \
-_COOKIE.checksum= ${WRKDIR}/.checksum_done
+# _COOKIE.checksum
+# The file whose presence determines whether or not the checksum
+# process is run.
+#
+# This is not a traditional cookie file. We do not actually
+# wish to create a cookie file for the completion of the checksum
+# phase because we want to be able to detect if any of the files
+# have changed right up until the distfiles are extracted.
+# Therefore, we use the presence of the cookie file from the
+# "extract" phase to determine whether we need to continue to
+# verify checksums.
+#
+# _COOKIE.extract is defined in pkgsrc/mk/extract/extract.mk.
+#
+_COOKIE.checksum= ${_COOKIE.extract}
-.PHONY: checksum
-checksum: ${_COOKIE.checksum}
-${_COOKIE.checksum}:
+checksum: do-checksum
+checksum:
.for _alg_ in ${_DIGEST_ALGORITHMS}
- ${_PKG_SILENT}${_PKG_DEBUG} \
+ ${RUN} set -e; \
+ ${TEST} ! -f ${_COOKIE.checksum} || exit 0; \
if cd ${DISTDIR} && ${_CHECKSUM_CMD} -a ${_alg_:Q} \
${DISTINFO_FILE} ${_CKSUMFILES}; then \
- if [ ${DO_CHECKSUM_REPEATEDLY} = no ]; then \
- ${MKDIR} ${.TARGET:H}; \
- ${ECHO} ${PKGNAME} > ${.TARGET}; \
- fi; \
+ ${TRUE}; \
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"; \