summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2007-08-31 16:30:11 +0000
committerjlam <jlam@pkgsrc.org>2007-08-31 16:30:11 +0000
commit1bffbe5e1d3fda573498db4253d9039b115f1e46 (patch)
tree08bab4291fbc18e7aa8f02c132328ec75a243c0b /mk
parent9d378f69384c1596f568cd9ef7a222ab586d84f2 (diff)
downloadpkgsrc-1bffbe5e1d3fda573498db4253d9039b115f1e46.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')
-rw-r--r--mk/bsd.pkg.barrier.mk4
-rw-r--r--mk/checksum/bsd.checksum.mk16
-rw-r--r--mk/checksum/checksum.mk21
3 files changed, 24 insertions, 17 deletions
diff --git a/mk/bsd.pkg.barrier.mk b/mk/bsd.pkg.barrier.mk
index 4d873318bcb..3f16f8750f9 100644
--- a/mk/bsd.pkg.barrier.mk
+++ b/mk/bsd.pkg.barrier.mk
@@ -1,11 +1,11 @@
-# $NetBSD: bsd.pkg.barrier.mk,v 1.13 2006/11/03 08:01:04 joerg Exp $
+# $NetBSD: bsd.pkg.barrier.mk,v 1.14 2007/08/31 16:30:11 jlam Exp $
_COOKIE.barrier= ${WRKDIR}/.barrier_cookie
# _BARRIER_PRE_TARGETS is a list of the targets that must be built before
# the "barrier" target invokes a new make.
#
-_BARRIER_PRE_TARGETS= checksum makedirs depends
+_BARRIER_PRE_TARGETS= checksum-phase makedirs depends
# _BARRIER_POST_TARGETS is a list of the targets that must be built after
# the "barrier" target invokes a new make. This list is specially
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 \