svn commit: r454336 - branches/2017Q4/Mk
Bryan Drewery
bdrewery at FreeBSD.org
Thu Nov 16 20:21:17 UTC 2017
Author: bdrewery
Date: Thu Nov 16 20:21:16 2017
New Revision: 454336
URL: https://svnweb.freebsd.org/changeset/ports/454336
Log:
MFH: r454266 r454332
Fix [DE]SELECTED_OPTIONS to lazily evaluate as late as possible.
If a port modifies OPTIONS_UNSET after including bsd.port.options.mk
then these values were wrong even though all of 'showconfig',
'pretty-print-config', and the package generated all had the expected
options.
Only Poudriere and synth use these variables for incremental build checks.
Reviewed by: sjg, bapt
Approved by: portmgr (bapt)
Differential Revision: https://reviews.freebsd.org/D13092
Follow-up r454266: Sort and remove duplicates for [DE]SELECTED_OPTIONS.
Some ports like graphics/povray-meta do funky things like add the same
option into PORT_OPTIONS twice. This also avoids a new leading blank
space in some cases.
With hat: portmgr
Approved by: portmgr (implicit)
Modified:
branches/2017Q4/Mk/bsd.options.mk
Directory Properties:
branches/2017Q4/ (props changed)
Modified: branches/2017Q4/Mk/bsd.options.mk
==============================================================================
--- branches/2017Q4/Mk/bsd.options.mk Thu Nov 16 20:19:10 2017 (r454335)
+++ branches/2017Q4/Mk/bsd.options.mk Thu Nov 16 20:21:16 2017 (r454336)
@@ -640,23 +640,18 @@ _OPTIONS_${_target}:= ${_OPTIONS_${_target}} ${_prio}:
.undef (SELECTED_OPTIONS)
.undef (DESELECTED_OPTIONS)
-.for opt in ${ALL_OPTIONS}
-. if ${PORT_OPTIONS:M${opt}}
-SELECTED_OPTIONS:= ${opt} ${SELECTED_OPTIONS}
-. else
-DESELECTED_OPTIONS:= ${opt} ${DESELECTED_OPTIONS}
-. endif
-.endfor
+# Wait to expand PORT_OPTIONS until the last moment in case something modifies
+# the selected OPTIONS after bsd.port.options.mk is included. This uses
+# bmake's :@ for loop.
+_SELECTED_OPTIONS= ${ALL_OPTIONS:@opt@${PORT_OPTIONS:M${opt}}@}
+_DESELECTED_OPTIONS= ${ALL_OPTIONS:@opt@${"${PORT_OPTIONS:M${opt}}":?:${opt}}@}
.for otype in MULTI GROUP SINGLE RADIO
. for m in ${OPTIONS_${otype}}
-. for opt in ${OPTIONS_${otype}_${m}}
-. if ${PORT_OPTIONS:M${opt}}
-SELECTED_OPTIONS:= ${opt} ${SELECTED_OPTIONS}
-. else
-DESELECTED_OPTIONS:= ${opt} ${DESELECTED_OPTIONS}
-. endif
-. endfor
+_SELECTED_OPTIONS+= ${OPTIONS_${otype}_${m}:@opt@${PORT_OPTIONS:M${opt}}@}
+_DESELECTED_OPTIONS+= ${OPTIONS_${otype}_${m}:@opt@${"${PORT_OPTIONS:M${opt}}":?:${opt}}@}
. endfor
.endfor
+SELECTED_OPTIONS= ${_SELECTED_OPTIONS:O:u}
+DESELECTED_OPTIONS= ${_DESELECTED_OPTIONS:O:u}
.endif
More information about the svn-ports-all
mailing list