pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk Move digest dependency into checksum and fetch part.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ed3ff5abef63
branches:  trunk
changeset: 542609:ed3ff5abef63
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Thu May 22 16:27:22 2008 +0000

description:
Move digest dependency into checksum and fetch part.
Make _ALL_FILES and in turn _CKSUMFILES available earlier.
Use it to only depend on digest if _CKSUMFILES is non-empty.
NO_CHECKSUM will now only skip the checksum and checksum-phase
targets. FAILOVER_FETCH will independently check the sums on
distfiles and depend on digest, fixing the remaining issues
originally raised in PR 34914.

diffstat:

 mk/bsd.pkg.mk                    |   5 +----
 mk/checksum/bsd.checksum-vars.mk |   6 +++++-
 mk/checksum/bsd.checksum.mk      |  13 +++++--------
 mk/checksum/checksum.mk          |   9 +++++++--
 mk/fetch/bsd.fetch-vars.mk       |  38 +++++++++++++++++++++++++++++++-------
 mk/fetch/fetch.mk                |  26 +-------------------------
 6 files changed, 50 insertions(+), 47 deletions(-)

diffs (210 lines):

diff -r 84e25500fdb7 -r ed3ff5abef63 mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Thu May 22 16:04:39 2008 +0000
+++ b/mk/bsd.pkg.mk     Thu May 22 16:27:22 2008 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1942 2008/05/21 19:53:59 tnn Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1943 2008/05/22 16:27:22 joerg Exp $
 #
 # This file is in the public domain.
 #
@@ -84,7 +84,6 @@
 #
 .if defined(META_PACKAGE)
 PKG_DESTDIR_SUPPORT=   user-destdir
-NO_CHECKSUM=           yes
 NO_CONFIGURE=          yes
 NO_BUILD=              yes
 DISTFILES=             # none
@@ -404,8 +403,6 @@
        mkdir mv pax printf pwd rm rmdir sed sh sort                    \
        tail test touch tr true wc xargs
 
-USE_TOOLS+=    ${NO_CHECKSUM:D:Udigest\:bootstrap}
-
 # bsd.wrapper.mk
 USE_TOOLS+=    expr
 
diff -r 84e25500fdb7 -r ed3ff5abef63 mk/checksum/bsd.checksum-vars.mk
--- a/mk/checksum/bsd.checksum-vars.mk  Thu May 22 16:04:39 2008 +0000
+++ b/mk/checksum/bsd.checksum-vars.mk  Thu May 22 16:27:22 2008 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.checksum-vars.mk,v 1.1 2006/07/13 14:02:34 jlam Exp $
+# $NetBSD: bsd.checksum-vars.mk,v 1.2 2008/05/22 16:27:22 joerg Exp $
 #
 # This Makefile fragment is included separately by bsd.pkg.mk and
 # defines some variables which must be defined earlier than where
@@ -10,3 +10,7 @@
 #
 
 DISTINFO_FILE?=                ${PKGDIR}/distinfo
+
+.if !empty(_CKSUMFILES)
+USE_TOOLS+=    digest:bootstrap
+.endif
diff -r 84e25500fdb7 -r ed3ff5abef63 mk/checksum/bsd.checksum.mk
--- a/mk/checksum/bsd.checksum.mk       Thu May 22 16:04:39 2008 +0000
+++ b/mk/checksum/bsd.checksum.mk       Thu May 22 16:27:22 2008 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.checksum.mk,v 1.8 2008/01/04 01:46:26 rillig Exp $
+# $NetBSD: bsd.checksum.mk,v 1.9 2008/05/22 16:27:22 joerg Exp $
 #
 # This Makefile fragment is included by bsd.pkg.mk and defines the
 # relevant variables and targets for the "checksum" phase.
@@ -30,9 +30,11 @@
 # Package-settable variables:
 #
 # NO_CHECKSUM
-#      When defined, no checksums are generated for patches or
+#      When defined, no checksums are validated for patches or
 #      distfiles.
 #
+#      Note: This does not alter the behaviour of FAILOVER_FETCH.
+#
 #      Default value: undefined
 #
 
@@ -43,9 +45,4 @@
 makedistinfo mdi: distinfo
 mps: makepatchsum
 
-.if defined(NO_CHECKSUM)
-checksum checksum-phase makesum makepatchsum mps mdi makedistinfo distinfo:
-       @${DO_NADA}
-.else
-.  include "checksum.mk"
-.endif
+.include "checksum.mk"
diff -r 84e25500fdb7 -r ed3ff5abef63 mk/checksum/checksum.mk
--- a/mk/checksum/checksum.mk   Thu May 22 16:04:39 2008 +0000
+++ b/mk/checksum/checksum.mk   Thu May 22 16:27:22 2008 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: checksum.mk,v 1.12 2007/10/09 19:19:13 martti Exp $
+# $NetBSD: checksum.mk,v 1.13 2008/05/22 16:27:22 joerg Exp $
 #
 # See bsd.checksum.mk for helpful comments.
 #
@@ -6,7 +6,7 @@
 _DIGEST_ALGORITHMS?=           SHA1 RMD160
 _PATCH_DIGEST_ALGORITHMS?=     SHA1
 
-# These variables are set by pkgsrc/mk/fetch/fetch.mk.
+# These variables are set by pkgsrc/mk/fetch/bsd.fetch-vars.mk.
 #_CKSUMFILES?= # empty
 #_IGNOREFILES?=        # empty
 
@@ -32,6 +32,10 @@
                TEST=${TOOLS_TEST:Q}                                    \
        ${SH} ${PKGSRCDIR}/mk/checksum/checksum                         \
 
+.if defined(NO_CHECKSUM)
+checksum checksum-phase:
+       @${DO_NADA}
+.else
 checksum checksum-phase:
        ${RUN} set -e;                                                  \
        case ${.TARGET:Q} in                                            \
@@ -45,6 +49,7 @@
                ${ERROR_MSG} "\"${MAKE} NO_CHECKSUM=yes [other args]\"."; \
                exit 1;                                                 \
        fi
+.endif
 
 _DISTINFO_CMD= ${SETENV} DIGEST=${TOOLS_DIGEST:Q} SED=${TOOLS_SED:Q}   \
                        TEST=${TOOLS_TEST:Q} WC=${TOOLS_WC:Q}           \
diff -r 84e25500fdb7 -r ed3ff5abef63 mk/fetch/bsd.fetch-vars.mk
--- a/mk/fetch/bsd.fetch-vars.mk        Thu May 22 16:04:39 2008 +0000
+++ b/mk/fetch/bsd.fetch-vars.mk        Thu May 22 16:27:22 2008 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.fetch-vars.mk,v 1.9 2007/11/02 09:02:57 rillig Exp $
+# $NetBSD: bsd.fetch-vars.mk,v 1.10 2008/05/22 16:27:22 joerg Exp $
 #
 # This Makefile fragment is included separately by bsd.pkg.mk and
 # defines some variables which must be defined earlier than where
@@ -39,13 +39,30 @@
 DEFAULT_DISTFILES=     ${DISTNAME}${EXTRACT_SUFX}
 DISTFILES?=            ${DEFAULT_DISTFILES}
 
-# "Failover" fetching requires the digest tool to compute checksums to
-# verify any fetched files.  But if no checksumming is requested, don't
-# add it.
-#
-.if defined(FAILOVER_FETCH) && !defined(NO_CHECKSUM)
-USE_TOOLS+=            ${FAILOVER_FETCH:Ddigest\:bootstrap}
+# File lists, defined early to allow tool dependencies.
+ALLFILES?=     ${DISTFILES} ${PATCHFILES}
+ALLFILES:=     ${ALLFILES:O:u}         # remove duplicates
+CKSUMFILES?=   ${ALLFILES}
+.for __tmp__ in ${IGNOREFILES}
+CKSUMFILES:=   ${CKSUMFILES:N${__tmp__}}
+.endfor
+
+# List of all files, with ${DIST_SUBDIR} in front.  Used for fetch and checksum.
+.if defined(DIST_SUBDIR) && !empty(DIST_SUBDIR)
+_CKSUMFILES?=  ${CKSUMFILES:@.f.@${DIST_SUBDIR}/${.f.}@}
+_DISTFILES?=   ${DISTFILES:@.f.@${DIST_SUBDIR}/${.f.}@}
+_IGNOREFILES?= ${IGNOREFILES:@.f.@${DIST_SUBDIR}/${.f.}@}
+_PATCHFILES?=  ${PATCHFILES:@.f.@${DIST_SUBDIR}/${.f.}@}
+.else
+_CKSUMFILES?=  ${CKSUMFILES}
+_DISTFILES?=   ${DISTFILES}
+_IGNOREFILES?= ${IGNOREFILES}
+_PATCHFILES?=  ${PATCHFILES}
 .endif
+_ALLFILES?=    ${_DISTFILES} ${_PATCHFILES}
+_ALLFILES:=    ${_ALLFILES:O:u}        # remove duplicates
+
+_BUILD_DEFS+=  _DISTFILES _PATCHFILES
 
 # When mirroring distfiles which others may fetch, only fetch the
 # distfiles if it is allowed to be re-distributed freely.  Also,
@@ -55,3 +72,10 @@
 NO_SKIP=               # defined
 _BOOTSTRAP_VERBOSE=    # defined
 .endif
+
+.if !empty(_CKSUMFILES)
+#USE_TOOLS+=   ftp:bootstrap
+.  if defined(FAILOVER_FETCH)
+USE_TOOLS+=    digest:bootstrap
+.  endif
+.endif
diff -r 84e25500fdb7 -r ed3ff5abef63 mk/fetch/fetch.mk
--- a/mk/fetch/fetch.mk Thu May 22 16:04:39 2008 +0000
+++ b/mk/fetch/fetch.mk Thu May 22 16:27:22 2008 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: fetch.mk,v 1.33 2008/04/03 14:07:51 joerg Exp $
+# $NetBSD: fetch.mk,v 1.34 2008/05/22 16:27:22 joerg Exp $
 
 _MASTER_SITE_BACKUP=   ${MASTER_SITE_BACKUP:=${DIST_SUBDIR}${DIST_SUBDIR:D/}}
 _MASTER_SITE_OVERRIDE= ${MASTER_SITE_OVERRIDE:=${DIST_SUBDIR}${DIST_SUBDIR:D/}}
@@ -6,30 +6,6 @@
 # Where to put distfiles that don't have any other master site
 MASTER_SITE_LOCAL?=    ${MASTER_SITE_BACKUP:=LOCAL_PORTS/}
 
-ALLFILES?=     ${DISTFILES} ${PATCHFILES}
-ALLFILES:=     ${ALLFILES:O:u}         # remove duplicates
-CKSUMFILES?=   ${ALLFILES}
-.for __tmp__ in ${IGNOREFILES}
-CKSUMFILES:=   ${CKSUMFILES:N${__tmp__}}
-.endfor
-
-# List of all files, with ${DIST_SUBDIR} in front.  Used for fetch and checksum.
-.if defined(DIST_SUBDIR) && !empty(DIST_SUBDIR)
-_CKSUMFILES?=  ${CKSUMFILES:@.f.@${DIST_SUBDIR}/${.f.}@}
-_DISTFILES?=   ${DISTFILES:@.f.@${DIST_SUBDIR}/${.f.}@}
-_IGNOREFILES?= ${IGNOREFILES:@.f.@${DIST_SUBDIR}/${.f.}@}
-_PATCHFILES?=  ${PATCHFILES:@.f.@${DIST_SUBDIR}/${.f.}@}
-.else
-_CKSUMFILES?=  ${CKSUMFILES}
-_DISTFILES?=   ${DISTFILES}
-_IGNOREFILES?= ${IGNOREFILES}
-_PATCHFILES?=  ${PATCHFILES}
-.endif
-_ALLFILES?=    ${_DISTFILES} ${_PATCHFILES}
-_ALLFILES:=    ${_ALLFILES:O:u}        # remove duplicates
-
-_BUILD_DEFS+=  _DISTFILES _PATCHFILES
-
 # Set up _ORDERED_SITES to work out the exact list of sites for every file,
 # using the dynamic sites script, or ordering according to the master site
 # list, MASTER_SORT_RANDOM randomization feature, or the patterns in



Home | Main Index | Thread Index | Old Index