Page MenuHomeFreeBSD

Fix [DE]SELECTED_OPTIONS to lazily evaluate.

Authored by bdrewery on Nov 14 2017, 7:37 PM.



If a port modifies OPTIONS_UNSET after including
then these values were wrong even though all of 'showconfig',
'pretty-print-config', and the package generated all had the expected

Only Poudriere and synth use these variables for incremental build checks.
My initial thoughts were that the print/ghostscript9-agpl-base/files/Makefile.drivers_post
file is wrong for modifying OPTIONS this late but the fact that all
other options printers and the package work as the port expects makes
me accept it.

The alternative to using bmake :@ here would be to move the existing
code to at the end of the pre-check-config block.

Test Plan

Some local poudriere bulk runs.


% cd print/ghostscript9-agpl-base
% echo "print_ghostscript9-agpl-base_UNSET= CUPS" >> /etc/make.conf
% make -V 'SELECTED_OPTIONS:tl:M*cups*'
GS_png48 CUPS


% cd print/ghostscript9-agpl-base
% echo "print_ghostscript9-agpl-base_UNSET= CUPS" >> /etc/make.conf
% make -V 'SELECTED_OPTIONS:tl:M*cups*'

CUPS GS_cups GS_png48

Diff Detail

rP FreeBSD ports repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

bdrewery created this revision.Nov 14 2017, 7:37 PM
Herald added a subscriber: mat. · View Herald Transcript
sjg accepted this revision.Nov 14 2017, 11:51 PM

:@ rocks

In D13092#272310, @sjg wrote:

:@ rocks

Yup, I had this originally but I couldn't get DESLECTED_OPTIONS to work nicely and I felt it was too obscure.

SELECTED_OPTIONS= ${ALL_OPTIONS:@opt@${PORT_OPTIONS:M${opt}}@} ${MULTI GROUP SINGLE RADIO:L:@otype@${OPTIONS_${otype}:@m@${OPTIONS_${otype}_${m}:@opt@${PORT_OPTIONS:M${opt}}@}@}@}
bapt accepted this revision.Nov 15 2017, 9:47 AM
This revision is now accepted and ready to land.Nov 15 2017, 9:47 AM
bapt added a comment.Nov 15 2017, 9:47 AM

Note that other places may benefit :@

This revision was automatically updated to reflect the committed changes.
mat added a comment.Nov 24 2017, 2:18 PM

If a port modifies OPTIONS_UNSET after including

But, OPTIONS_SET/UNSET are variables that can only be used in /etc/make.conf, so this case should not happen. Which port does something stupid like this ?