pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk The new target do-check-pkg-fail-reason should to b...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/70612fb9f873
branches:  trunk
changeset: 503824:70612fb9f873
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Thu Dec 01 00:17:05 2005 +0000

description:
The new target do-check-pkg-fail-reason should to be 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. It provides the same action
as the "main" targets like "fetch", "expand", "build" before in case
PKG_FAIL_REASON is set, that is it prints all PKG_FAIL_REASONs and
fails.

Fixes PR 32202.

Implementation notes:
- The target names have the "do-" prefix to not pollute the
  bsd.pkg.check.mk namespace.
- The PKG_SKIP_REASON has no influence on the do-check-pkg-fail-reason
  target, although both are handled with the same code.

diffstat:

 mk/bsd.pkg.mk |  18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diffs (47 lines):

diff -r 53227508f3c1 -r 70612fb9f873 mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Wed Nov 30 22:48:24 2005 +0000
+++ b/mk/bsd.pkg.mk     Thu Dec 01 00:17:05 2005 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1769 2005/11/29 22:18:38 reed Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1770 2005/12/01 00:17:05 rillig Exp $
 #
 # This file is in the public domain.
 #
@@ -974,8 +974,9 @@
 # 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 install-depends:
+update install-depends do-check-pkg-fail-or-skip-reason:
 .    if defined(SKIP_SILENT)
        @${DO_NADA}
 .    else
@@ -989,6 +990,17 @@
 .  endif # SKIP
 .endif # !NO_SKIP
 
+.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
+
 # Add these defs to the ones dumped into +BUILD_DEFS
 BUILD_DEFS+=   PKGPATH
 BUILD_DEFS+=   OPSYS OS_VERSION MACHINE_ARCH MACHINE_GNU_ARCH
@@ -1390,7 +1402,7 @@
 .PHONY: show-depends-dirs
 .if !target(show-depends-dirs)
 _ALL_DEPENDS=          ${DEPENDS} ${BUILD_DEPENDS}
-show-depends-dirs:
+show-depends-dirs: do-check-pkg-fail-reason
        @dlist="";                                                      \
        depends=${_ALL_DEPENDS:C/^[^:]*://:O:u:Q};                      \
        for reldir in $$depends; do                                     \



Home | Main Index | Thread Index | Old Index