pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk Moved the check for PKG_FAIL_REASON and PKG_SKIP_RE...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/54b9c9244bee
branches:  trunk
changeset: 521652:54b9c9244bee
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Thu Nov 16 09:38:53 2006 +0000

description:
Moved the check for PKG_FAIL_REASON and PKG_SKIP_REASON at the very end
of bsd.pkg.mk, so that all infrastructure parts may add their error
messages to PKG_FAIL_REASON.

diffstat:

 mk/bsd.pkg.mk                  |   5 +--
 mk/internal/pkg_fail_reason.mk |  58 ++++++++++++++++++-----------------------
 2 files changed, 28 insertions(+), 35 deletions(-)

diffs (100 lines):

diff -r 57eed67395a9 -r 54b9c9244bee mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Thu Nov 16 09:24:52 2006 +0000
+++ b/mk/bsd.pkg.mk     Thu Nov 16 09:38:53 2006 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1896 2006/11/14 13:56:14 rillig Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1897 2006/11/16 09:38:53 rillig Exp $
 #
 # This file is in the public domain.
 #
@@ -563,8 +563,6 @@
 .  endif       # !__PLATFORM_OK
 .endif
 
-.include "${.PARSEDIR}/internal/pkg_fail_reason.mk"
-
 # Add these defs to the ones dumped into +BUILD_DEFS
 _BUILD_DEFS+=  PKGPATH
 _BUILD_DEFS+=  OPSYS OS_VERSION MACHINE_ARCH MACHINE_GNU_ARCH
@@ -916,3 +914,4 @@
 .if make(help)
 .include "${PKGSRCDIR}/mk/help/help.mk"
 .endif
+.include "${.PARSEDIR}/internal/pkg_fail_reason.mk"
diff -r 57eed67395a9 -r 54b9c9244bee mk/internal/pkg_fail_reason.mk
--- a/mk/internal/pkg_fail_reason.mk    Thu Nov 16 09:24:52 2006 +0000
+++ b/mk/internal/pkg_fail_reason.mk    Thu Nov 16 09:38:53 2006 +0000
@@ -1,47 +1,41 @@
-# $NetBSD: pkg_fail_reason.mk,v 1.1 2006/11/14 13:56:14 rillig Exp $
+# $NetBSD: pkg_fail_reason.mk,v 1.2 2006/11/16 09:38:53 rillig Exp $
 #
 
 # This file prints the error that are collected when the Makefiles are
 # loaded.
 #
 
-.if !defined(NO_SKIP)
+PKG_FAIL_REASON?=      # none
+PKG_SKIP_REASON?=      # none
 
-#
-# Now print some error messages that we know we should ignore the pkg
-#
-.  if defined(PKG_FAIL_REASON) || defined(PKG_SKIP_REASON)
-.PHONY: do-check-pkg-fail-or-skip-reason
-fetch checksum extract patch configure all build install package \
-update depends do-check-pkg-fail-or-skip-reason:
-.    if defined(SKIP_SILENT)
+.PHONY: _check-pkg-fail-reason
+_check-pkg-fail-reason: .USEBEFORE
+.if defined(SKIP_SILENT)
        @${DO_NADA}
-.    else
-.      if defined(PKG_FAIL_REASON) && !empty(PKG_FAIL_REASON:M*)
+.else
+.  if !empty(PKG_FAIL_REASON:M*)
        @for str in ${PKG_FAIL_REASON}; do                              \
                ${ERROR_MSG} "$$str";                                   \
        done
-.      endif
-.      if defined(PKG_SKIP_REASON) && !empty(PKG_SKIP_REASON:M*)
-       @${WARNING_MSG} "Skipping ${PKGNAME}:";                         \
-       for str in ${PKG_SKIP_REASON}; do                               \
+.  endif
+.  if !empty(PKG_SKIP_REASON:M*)
+       @for str in "Skipping ${PKGNAME}:" ${PKG_SKIP_REASON}; do       \
                ${WARNING_MSG} "$$str";                                 \
        done
-.      endif
-.    endif
-.    if defined(PKG_FAIL_REASON) && !empty(PKG_FAIL_REASON:M*)
+.  endif
+.endif
+.if !empty(PKG_FAIL_REASON:M*)
        @${FALSE}
-.    endif
-.  endif # SKIP
-.endif # !NO_SKIP
+.endif
 
-.PHONY: do-check-pkg-fail-reason
-do-check-pkg-fail-reason:
-       @${DO_NADA}
-
-# This target should appear as a dependency of every top level target that
-# is intended to be called by the user or by a package different from the
-# current package.
-.if defined(PKG_FAIL_REASON)
-do-check-pkg-fail-reason: do-check-pkg-fail-or-skip-reason
-.endif
+# All the "public" targets should be listed here.
+#
+.if !defined(NO_SKIP)
+.  if !empty(PKG_FAIL_REASON) || !empty(PKG_SKIP_REASON)
+# FIXME: check-vulnerable is only used here because it is depended
+# upon by each of the "main" pkgsrc targets. Probably its name should be
+# generalized, and both check-vulnerable and _check-pkg-fail-reason should
+# depend on the generalized target.
+check-vulnerable: _check-pkg-fail-reason
+.  endif
+.endif # !NO_SKIP



Home | Main Index | Thread Index | Old Index