Page MenuHomeFreeBSD

net/unison*, audio/asterisk-*: Fix syntax errors in how FLAVOR is set
ClosedPublic

Authored by tobik on Nov 24 2019, 8:03 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Mar 19, 10:09 AM
Unknown Object (File)
Sat, Mar 9, 8:00 PM
Unknown Object (File)
Sat, Mar 9, 8:00 PM
Unknown Object (File)
Sat, Mar 9, 8:00 PM
Unknown Object (File)
Sat, Mar 9, 7:48 PM
Unknown Object (File)
Jan 30 2024, 12:01 AM
Unknown Object (File)
Jan 18 2024, 5:05 AM
Unknown Object (File)
Jan 6 2024, 7:27 PM
Subscribers
None

Details

Summary

Something like ${FLAVORS[1]} looks up a variable named FLAVORS[1].
It is not equivalent to ${FLAVORS:[1]} which looks up the first
word of a variable named FLAVORS. The second form is what should
be used to set FLAVOR as otherwise it is set to an empty value
and we might as well replace FLAVOR?=${FLAVORS[1]} with FLAVOR?=.
This potentially breaks ports builds of the default flavor outside
of Poudriere since something like

FLAVORS=	foo bar
FLAVOR?=	${FLAVORS[1]}
.if ${FLAVOR} == foo
# ...
.else
# ...
.endif

will *always* take the else branch.

In the asterisk-* ports we do not really need to set FLAVOR but
I left it in anyway.

Test Plan

Poison ports with

.if empty(FLAVOR)
.error whoops
.endif

directly after FLAVOR?=. It should produce an error before
applying this change but not afterwards.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Thanks for noticing this. It clearly was an oversight on my part!

This revision is now accepted and ready to land.Nov 24 2019, 10:01 AM