pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/checksum Removed many redundant comments and restru...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/2905cbbbc409
branches:  trunk
changeset: 526287:2905cbbbc409
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Wed Mar 07 01:06:11 2007 +0000

description:
Removed many redundant comments and restructured the code, so that it
becomes a little shorter.

diffstat:

 mk/checksum/bsd.checksum.mk |  68 +++++++++++++++++++++-----------------------
 mk/checksum/checksum.mk     |  34 +++++-----------------
 2 files changed, 41 insertions(+), 61 deletions(-)

diffs (155 lines):

diff -r 746ba1508e1b -r 2905cbbbc409 mk/checksum/bsd.checksum.mk
--- a/mk/checksum/bsd.checksum.mk       Wed Mar 07 00:33:24 2007 +0000
+++ b/mk/checksum/bsd.checksum.mk       Wed Mar 07 01:06:11 2007 +0000
@@ -1,47 +1,45 @@
-# $NetBSD: bsd.checksum.mk,v 1.4 2006/09/19 00:03:44 rillig Exp $
+# $NetBSD: bsd.checksum.mk,v 1.5 2007/03/07 01:06:11 rillig Exp $
 #
 # This Makefile fragment is included by bsd.pkg.mk and defines the
 # relevant variables and targets for the "checksum" phase.
 #
-# The following are the "public" targets provided by this module:
+# Public targets for pkgsrc users:
+#
+# checksum:
+#      Check that the distfiles have the correct checksums. If they
+#      aren't yet fetched, fetch them.
+#
+# Public targets for pkgsrc developers:
+#
+# makesum:
+#      Add or update the checksums of the distfiles to ${DISTINFO_FILE}.
+#
+#      See also: patchsum
 #
-#    checksum, makesum, makepatchsum, distinfo
+# makepatchsum, mps:
+#      Add or update the checksums of the patches to ${DISTINFO_FILE}.
+#
+# makedistinfo, distinfo, mdi:
+#      Create or update the checksums in ${DISTINFO_FILE}.
+#
+# Package-settable variables:
+#
+# NO_CHECKSUM
+#      When defined, no checksums are generated for patches or
+#      distfiles.
+#
+#      Default value: undefined
 #
 
-######################################################################
-### checksum, makesum, makepatchsum (PUBLIC)
-######################################################################
-### checksum is a public target to checksum the fetched distfiles
-### for the package.
-###
-### makesum is a public target to add checksums of the distfiles for
-### the package to ${DISTINFO_FILE}.
-###
-### makepatchsum is a public target to add checksums of the patches
-### for the package to ${DISTINFO_FILE}.
-###
+.PHONY: checksum makesum makepatchsum mps mdi makedistinfo distinfo
+
+checksum makesum: fetch
+makedistinfo distinfo mdi: makepatchsum makesum
+mps: makepatchsum
+
 .if defined(NO_CHECKSUM)
-.PHONY: checksum makesum makepatchsum
-.  if !target(checksum)
-checksum: fetch
-       @${DO_NADA}
-.  endif
-makesum makepatchsum:
+checksum makesum makepatchsum mps mdi makedistinfo distinfo:
        @${DO_NADA}
 .else
 .  include "${PKGSRCDIR}/mk/checksum/checksum.mk"
 .endif
-
-######################################################################
-### distinfo (PUBLIC)
-######################################################################
-### distinfo is a public target to create ${DISTINFO_FILE}.
-###
-.PHONY: distinfo
-distinfo: makepatchsum makesum
-       @${DO_NADA}
-
-# Some short aliases for "makepatchsum" and "distinfo".
-.PHONY: mps mdi makedistinfo
-mps: makepatchsum
-mdi makedistinfo: distinfo
diff -r 746ba1508e1b -r 2905cbbbc409 mk/checksum/checksum.mk
--- a/mk/checksum/checksum.mk   Wed Mar 07 00:33:24 2007 +0000
+++ b/mk/checksum/checksum.mk   Wed Mar 07 01:06:11 2007 +0000
@@ -1,4 +1,7 @@
-# $NetBSD: checksum.mk,v 1.3 2007/02/20 09:53:23 rillig Exp $
+# $NetBSD: checksum.mk,v 1.4 2007/03/07 01:06:11 rillig Exp $
+#
+# See bsd.checksum.mk for helpful comments.
+#
 
 _DIGEST_ALGORITHMS?=           SHA1 RMD160
 _PATCH_DIGEST_ALGORITHMS?=     SHA1
@@ -11,12 +14,6 @@
 #_CKSUMFILES?= # empty
 #_IGNOREFILES?=        # empty
 
-######################################################################
-### checksum (PUBLIC)
-######################################################################
-### checksum is a public target to checksum the fetched distfiles
-### for the package.
-###
 _CHECKSUM_CMD=                                                         \
        ${SETENV} DIGEST=${TOOLS_DIGEST:Q} CAT=${TOOLS_CAT:Q}           \
                ECHO=${TOOLS_ECHO:Q} TEST=${TOOLS_TEST:Q}               \
@@ -25,10 +22,9 @@
 _COOKIE.checksum=      ${WRKDIR}/.checksum_done
 
 .PHONY: checksum
-.if !target(checksum)
-checksum: fetch ${_COOKIE.checksum}
+checksum: ${_COOKIE.checksum}
 ${_COOKIE.checksum}:
-.  for _alg_ in ${_DIGEST_ALGORITHMS}
+.for _alg_ in ${_DIGEST_ALGORITHMS}
        ${_PKG_SILENT}${_PKG_DEBUG}                                     \
        if cd ${DISTDIR} && ${_CHECKSUM_CMD} -a ${_alg_:Q}              \
                ${DISTINFO_FILE} ${_CKSUMFILES}; then                   \
@@ -42,17 +38,9 @@
                ${ERROR_MSG} "\"${MAKE} NO_CHECKSUM=yes [other args]\"."; \
                exit 1;                                                 \
        fi
-.  endfor
-.endif
+.endfor
 
-######################################################################
-### makesum (PUBLIC)
-######################################################################
-### makesum is a public target to add checksums of the distfiles for
-### the package to ${DISTINFO_FILE}.
-###
-.PHONY: makesum
-makesum: fetch
+makesum:
        ${_PKG_SILENT}${_PKG_DEBUG}set -e;                              \
        newfile=${DISTINFO_FILE}.$$$$;                                  \
        if ${TEST} -f ${DISTINFO_FILE}; then                            \
@@ -91,12 +79,6 @@
                ${MV} -f $$newfile ${DISTINFO_FILE};                    \
        fi
 
-######################################################################
-### makepatchsum (PUBLIC)
-######################################################################
-### makepatchsum is a public target to add checksums of the patches
-### for the package to ${DISTINFO_FILE}.
-###
 makepatchsum:
        ${_PKG_SILENT}${_PKG_DEBUG}set -e;                              \
        newfile=${DISTINFO_FILE}.$$$$;                                  \



Home | Main Index | Thread Index | Old Index