pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk Moved the code that checks PKG_FAIL_REASON and PKG_...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/2e3ad5af2319
branches:  trunk
changeset: 521556:2e3ad5af2319
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Tue Nov 14 13:56:14 2006 +0000

description:
Moved the code that checks PKG_FAIL_REASON and PKG_SKIP_REASON into its
own file. The further plan is not to include this file in the middle of
loading, but at the end, when no variables will be changed. This will
allow the _whole_ pkgsrc infrastructure to generate errors with
PKG_FAIL_REASON, which is currently not the case.

diffstat:

 mk/bsd.pkg.mk                  |  42 ++----------------------------------
 mk/internal/pkg_fail_reason.mk |  47 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+), 39 deletions(-)

diffs (108 lines):

diff -r 77450c7b5613 -r 2e3ad5af2319 mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Tue Nov 14 13:55:34 2006 +0000
+++ b/mk/bsd.pkg.mk     Tue Nov 14 13:56:14 2006 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1895 2006/11/05 19:11:29 rillig Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1896 2006/11/14 13:56:14 rillig Exp $
 #
 # This file is in the public domain.
 #
@@ -561,45 +561,9 @@
 .  if !defined(__PLATFORM_OK)
 PKG_SKIP_REASON+= "${PKGNAME} is not available for ${MACHINE_PLATFORM}"
 .  endif       # !__PLATFORM_OK
+.endif
 
-#
-# 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)
-       @${DO_NADA}
-.    else
-.      if defined(PKG_FAIL_REASON) && !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                               \
-               ${WARNING_MSG} "$$str";                                 \
-       done
-.      endif
-.    endif
-.    if defined(PKG_FAIL_REASON) && !empty(PKG_FAIL_REASON:M*)
-       @${FALSE}
-.    endif
-.  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
+.include "${.PARSEDIR}/internal/pkg_fail_reason.mk"
 
 # Add these defs to the ones dumped into +BUILD_DEFS
 _BUILD_DEFS+=  PKGPATH
diff -r 77450c7b5613 -r 2e3ad5af2319 mk/internal/pkg_fail_reason.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mk/internal/pkg_fail_reason.mk    Tue Nov 14 13:56:14 2006 +0000
@@ -0,0 +1,47 @@
+# $NetBSD: pkg_fail_reason.mk,v 1.1 2006/11/14 13:56:14 rillig Exp $
+#
+
+# This file prints the error that are collected when the Makefiles are
+# loaded.
+#
+
+.if !defined(NO_SKIP)
+
+#
+# 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)
+       @${DO_NADA}
+.    else
+.      if defined(PKG_FAIL_REASON) && !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                               \
+               ${WARNING_MSG} "$$str";                                 \
+       done
+.      endif
+.    endif
+.    if defined(PKG_FAIL_REASON) && !empty(PKG_FAIL_REASON:M*)
+       @${FALSE}
+.    endif
+.  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



Home | Main Index | Thread Index | Old Index