NetBSD-Bugs archive

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

Re: toolchain/46750 (make oddity expanding variables assigned to with +=)

Synopsis: make oddity expanding variables assigned to with +=

State-Changed-From-To: open->feedback
State-Changed-When: Mon, 07 Feb 2022 23:11:18 +0000
Edgar, do you still think that '+=' semantics are broken?  I'm on
David's side on this topic, in that variable values are strings, and
in these, whitespace is relevant and is preserved.  While parsing an
assignment, whitespace around the value is removed though.

As soon as one of the split-into-words modifiers is applied to an
expression, the value of the variable is treated as a list of words, so
whitespace between the words becomes irrelevant and thus gets removed.
This is why an expression like ${:M*} normalizes whitespace in a list

I remember that for pkgsrc packages using GNU configure, pkglint warns:

// In GNU configure scripts, a few variables need to be passed through
// the :M* modifier before they reach the configure scripts. Otherwise
// the leading or trailing spaces will lead to strange caching errors
// since the GNU configure scripts cannot handle these space characters.

Do you have other practical examples where the space between words 

Home | Main Index | Thread Index | Old Index