pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk Introduce a new target "checksum-phase" which is us...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ecc1dd485e63
branches:  trunk
changeset: 532817:ecc1dd485e63
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Fri Aug 31 16:30:11 2007 +0000

description:
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:

 mk/bsd.pkg.barrier.mk       |   4 ++--
 mk/checksum/bsd.checksum.mk |  16 +++++++++++-----
 mk/checksum/checksum.mk     |  21 +++++++++++----------
 3 files changed, 24 insertions(+), 17 deletions(-)

diffs (102 lines):

diff -r 1e2e7669e516 -r ecc1dd485e63 mk/bsd.pkg.barrier.mk
--- a/mk/bsd.pkg.barrier.mk     Fri Aug 31 15:35:08 2007 +0000
+++ b/mk/bsd.pkg.barrier.mk     Fri Aug 31 16:30:11 2007 +0000
@@ -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 -r 1e2e7669e516 -r ecc1dd485e63 mk/checksum/bsd.checksum.mk
--- a/mk/checksum/bsd.checksum.mk       Fri Aug 31 15:35:08 2007 +0000
+++ b/mk/checksum/bsd.checksum.mk       Fri Aug 31 16:30:11 2007 +0000
@@ -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 -r 1e2e7669e516 -r ecc1dd485e63 mk/checksum/checksum.mk
--- a/mk/checksum/checksum.mk   Fri Aug 31 15:35:08 2007 +0000
+++ b/mk/checksum/checksum.mk   Fri Aug 31 16:30:11 2007 +0000
@@ -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 @@
 #_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 @@
 #
 _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                                                            \



Home | Main Index | Thread Index | Old Index