pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk mk/pkg-build-options: fail immediately if pkgbase i...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/34a372afda0a
branches:  trunk
changeset: 424762:34a372afda0a
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sun Mar 15 10:33:42 2020 +0000

description:
mk/pkg-build-options: fail immediately if pkgbase is not set

diffstat:

 mk/pkg-build-options.mk |  10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diffs (28 lines):

diff -r c23574a4ba66 -r 34a372afda0a mk/pkg-build-options.mk
--- a/mk/pkg-build-options.mk   Sun Mar 15 10:31:59 2020 +0000
+++ b/mk/pkg-build-options.mk   Sun Mar 15 10:33:42 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: pkg-build-options.mk,v 1.15 2020/03/14 13:28:38 wiz Exp $
+# $NetBSD: pkg-build-options.mk,v 1.16 2020/03/15 10:33:42 rillig Exp $
 #
 # This procedure determines the PKG_OPTIONS that have been in effect
 # when the package ${pkgbase} has been built. When the package is not
@@ -21,6 +21,12 @@
 # Keywords: options pkg-build-options PKG_BUILD_OPTIONS
 #
 
+.if !defined(pkgbase)
+.  for including in ${.INCLUDEDFROMDIR}/${.INCLUDEDFROMFILE}
+PKG_FAIL_REASON+=      "[pkg-build-options.mk] ${including}: pkgbase must be set"
+.  endfor
+.endif
+
 .include "bsd.fast.prefs.mk"
 
 # For the check for inclusion from non-buildlink3.mk, it is irrelevant
@@ -63,3 +69,5 @@
 MAKEVARS+=     PKG_BUILD_OPTIONS.${b}
 .  endfor
 .endif
+
+.undef pkgbase # prepare for the next invocation



Home | Main Index | Thread Index | Old Index