diff options
author | jlam <jlam> | 2007-08-31 16:30:11 +0000 |
---|---|---|
committer | jlam <jlam> | 2007-08-31 16:30:11 +0000 |
commit | 62cb106030a648ff26075580b86996b11036bb01 (patch) | |
tree | 08bab4291fbc18e7aa8f02c132328ec75a243c0b /mk/checksum | |
parent | 7893b1af1ae5df07d70a8123b8d0c4e5bbdfaba5 (diff) | |
download | pkgsrc-62cb106030a648ff26075580b86996b11036bb01.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.mk | 16 | ||||
-rw-r--r-- | mk/checksum/checksum.mk | 21 |
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 \ |