pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/checksum Restore the tradition behaviour of the "ch...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/da5834334efa
branches:  trunk
changeset: 532594:da5834334efa
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Fri Aug 24 03:11:01 2007 +0000

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

 mk/checksum/checksum.mk |  35 +++++++++++++++++++++--------------
 1 files changed, 21 insertions(+), 14 deletions(-)

diffs (60 lines):

diff -r 7833dd7bebe2 -r da5834334efa mk/checksum/checksum.mk
--- a/mk/checksum/checksum.mk   Fri Aug 24 02:42:50 2007 +0000
+++ b/mk/checksum/checksum.mk   Fri Aug 24 03:11:01 2007 +0000
@@ -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 @@
                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"; \



Home | Main Index | Thread Index | Old Index