pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/mk/buildlink3
Module Name: pkgsrc
Committed By: rillig
Date: Sat Jul 9 07:46:03 UTC 2022
Modified Files:
pkgsrc/mk/buildlink3: bsd.buildlink3.mk
Log Message:
mk/buildlink3: remove makefile hacks for NetBSD 5
pkgsrc does not support NetBSD 5 anymore.
Back then, when expanding the body of a .for loop, the variable values
were inserted verbatim in the body, allowing for lots of unintended
special effects, making it essentially impossible to use these values
directly in conditions.
In this case, the values do not contain double quotes, that's why
enclosing the ${_pkg_} in double quotes worked.
See src/usr.bin/make/unit-tests/directive-for.mk for more details,
search for '2008-12-21'.
Combining .for loops with 'empty(...)' conditions still does not work,
so replace these with direct comparisons. Before 2008-12-21, using
'empty(...)' was the safer variant because it avoided the uncontrolled
code injection.
No functional change.
To generate a diff of this commit:
cvs rdiff -u -r1.248 -r1.249 pkgsrc/mk/buildlink3/bsd.buildlink3.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/mk/buildlink3/bsd.buildlink3.mk
diff -u pkgsrc/mk/buildlink3/bsd.buildlink3.mk:1.248 pkgsrc/mk/buildlink3/bsd.buildlink3.mk:1.249
--- pkgsrc/mk/buildlink3/bsd.buildlink3.mk:1.248 Tue Jun 7 10:04:25 2022
+++ pkgsrc/mk/buildlink3/bsd.buildlink3.mk Sat Jul 9 07:46:02 2022
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.buildlink3.mk,v 1.248 2022/06/07 10:04:25 jperkin Exp $
+# $NetBSD: bsd.buildlink3.mk,v 1.249 2022/07/09 07:46:02 rillig Exp $
#
# Copyright (c) 2004 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -92,8 +92,7 @@ PREPEND_PATH+= ${BUILDLINK_BINDIR}
_BUILDLINK_DEPENDS:=
_BUILDLINK_DEPTH:=
.for _pkg_ in ${BUILDLINK_TREE}
-_BUILDLINK_pkg:= ${_pkg_:N-*}
-. if empty(_BUILDLINK_pkg)
+. if ${_pkg_:M-*}
_BUILDLINK_DEPTH:= ${_BUILDLINK_DEPTH:S/+$//}
. else
. if empty(_BUILDLINK_DEPTH)
@@ -122,22 +121,16 @@ BUILDLINK_BUILTIN_MK.${_pkg_}?= ${BUILDL
_stack_:=bot
_ok_:=yes
.for _pkg_ in ${BUILDLINK_TREE}
-# work around PR 47888
-_enter_:=${_pkg_:M-*}
-# work around another bug in netbsd-5's make (fixed in HEAD)
-_use_:=${USE_BUILTIN.${_pkg_:S/^-//}:M[Yy][Ee][Ss]}
-_ignore_:=${IGNORE_PKG.${_pkg_:S/^-//}:M[Yy][Ee][Ss]}
-
-. if "${_pkg_}" == "x11-links" || "${_pkg_}" == "-x11-links"
+. if ${_pkg_} == "x11-links" || ${_pkg_} == "-x11-links"
# (nothing)
-. elif empty(_enter_)
+. elif !${_pkg_:M-*}
# entering a package (in the buildlink tree)
#.say "${_stack_:C/.*/ /} ${_pkg_}:"
_stack_:=${_ok_} ${_stack_}
_ok_:=yes
. else
# leaving a package (in the buildlink tree)
-. if !empty(_use_)
+. if ${USE_BUILTIN.${_pkg_:S/^-//}:M[Yy][Ee][Ss]}
# this package is going to use the builtin version
. if ${_ok_} != yes
# not ok for it to be builtin; force it to pkgsrc
@@ -149,7 +142,7 @@ _ignore_:=${IGNORE_PKG.${_pkg_:S/^-//}:M
. else
#.say "${_stack_:C/.*/ /} ${_pkg_:S/^-//} built-in"
. endif
-. elif empty(_ignore_)
+. elif !${IGNORE_PKG.${_pkg_:S/^-//}:M[Yy][Ee][Ss]}
# no builtin version or not using it
#.say "${_stack_:C/.*/ /} ${_pkg_:S/^-//} pkgsrc"
. if ${_ok_} == yes
Home |
Main Index |
Thread Index |
Old Index