summaryrefslogtreecommitdiff
path: root/mk/checksum
diff options
context:
space:
mode:
authorjlam <jlam>2007-08-31 16:30:11 +0000
committerjlam <jlam>2007-08-31 16:30:11 +0000
commit36c0121bbccff5541e552c2533caf71865e1f367 (patch)
tree08bab4291fbc18e7aa8f02c132328ec75a243c0b /mk/checksum
parent0db0b44cff82c945cade0724f842e3795651d480 (diff)
downloadpkgsrc-36c0121bbccff5541e552c2533caf71865e1f367.tar.gz
Introduce a new target "checksum-phase" which is used as a dependency
target by pkgsrc. This new target computes checksums only up until the extract phase is complete. The "checksum" target is now a target that can always be run by the user at any time, regardless of the presence of the work directory. These changes were proposed in PR pkg/36603 by Robert Elz.
Diffstat (limited to 'mk/checksum')
-rw-r--r--mk/checksum/bsd.checksum.mk16
-rw-r--r--mk/checksum/checksum.mk21
2 files changed, 22 insertions, 15 deletions
diff --git a/mk/checksum/bsd.checksum.mk b/mk/checksum/bsd.checksum.mk
index 47604bd6b1f..3bb22223fb1 100644
--- a/mk/checksum/bsd.checksum.mk
+++ b/mk/checksum/bsd.checksum.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.checksum.mk,v 1.6 2007/08/14 19:08:18 jlam Exp $
+# $NetBSD: bsd.checksum.mk,v 1.7 2007/08/31 16:30:11 jlam Exp $
#
# This Makefile fragment is included by bsd.pkg.mk and defines the
# relevant variables and targets for the "checksum" phase.
@@ -7,7 +7,12 @@
#
# checksum:
# Check that the distfiles have the correct checksums. If they
-# aren't yet fetched, fetch them.
+# aren't yet fetched, fetch them. This target can be run at
+# any time and is meant to be run by the user.
+#
+# checksum-phase:
+# Same as "checksum" but is meant to run automatically by pkgsrc.
+# This target does not run after the "extract" phase is complete.
#
# Public targets for pkgsrc developers:
#
@@ -31,14 +36,15 @@
# Default value: undefined
#
-.PHONY: checksum makesum makepatchsum mps mdi makedistinfo distinfo
+.PHONY: checksum checksum-phase
+.PHONY: makesum makepatchsum mps mdi makedistinfo distinfo
-checksum distinfo makesum: fetch
+checksum checksum-phase distinfo makesum: fetch
makedistinfo mdi: distinfo
mps: makepatchsum
.if defined(NO_CHECKSUM)
-checksum makesum makepatchsum mps mdi makedistinfo distinfo:
+checksum checksum-phase makesum makepatchsum mps mdi makedistinfo distinfo:
@${DO_NADA}
.else
. include "${PKGSRCDIR}/mk/checksum/checksum.mk"
diff --git a/mk/checksum/checksum.mk b/mk/checksum/checksum.mk
index 8b7e50f03b2..6e950103a49 100644
--- a/mk/checksum/checksum.mk
+++ b/mk/checksum/checksum.mk
@@ -1,4 +1,4 @@
-# $NetBSD: checksum.mk,v 1.10 2007/08/24 03:30:54 jlam Exp $
+# $NetBSD: checksum.mk,v 1.11 2007/08/31 16:30:11 jlam Exp $
#
# See bsd.checksum.mk for helpful comments.
#
@@ -10,12 +10,6 @@ _PATCH_DIGEST_ALGORITHMS?= SHA1
#_CKSUMFILES?= # empty
#_IGNOREFILES?= # empty
-_CHECKSUM_CMD= \
- ${SETENV} DIGEST=${TOOLS_DIGEST:Q} CAT=${TOOLS_CAT:Q} \
- ECHO=${TOOLS_ECHO:Q} SED=${TOOLS_SED:Q} \
- TEST=${TOOLS_TEST:Q} \
- ${SH} ${PKGSRCDIR}/mk/checksum/checksum \
-
# _COOKIE.checksum
# The file whose presence determines whether or not the checksum
# process is run.
@@ -32,10 +26,17 @@ _CHECKSUM_CMD= \
#
_COOKIE.checksum= ${_COOKIE.extract}
-checksum: do-checksum
-do-checksum:
+_CHECKSUM_CMD= \
+ ${SETENV} DIGEST=${TOOLS_DIGEST:Q} CAT=${TOOLS_CAT:Q} \
+ ECHO=${TOOLS_ECHO:Q} SED=${TOOLS_SED:Q} \
+ TEST=${TOOLS_TEST:Q} \
+ ${SH} ${PKGSRCDIR}/mk/checksum/checksum \
+
+checksum checksum-phase:
${RUN} set -e; \
- ${TEST} ! -f ${_COOKIE.checksum} || exit 0; \
+ case ${.TARGET:Q} in \
+ *-phase) ${TEST} ! -f ${_COOKIE.checksum} || exit 0 ;; \
+ esac; \
if cd ${DISTDIR} && ${_CHECKSUM_CMD} ${DISTINFO_FILE} ${_CKSUMFILES}; then \
${TRUE}; \
else \