openSUSE / obs-build

OBS build script, can be used with OBS or stand alone
GNU General Public License v2.0
132 stars 184 forks source link

Add support for escaped spaces in values #965

Closed cbosdo closed 5 months ago

cbosdo commented 10 months ago

This change allows to use \ in BuildFlags values. For instance the following configuration will set KEY1 with value SPLIT VALUE and KEY2 with value VALUE2 to docker build.

BuildFlags: dockerargs:KEY1=SPLIT\ VALUE dockerargs:KEY2=VALUE2
mlschroe commented 7 months ago

Hmm, I'm not really in favor of doing it this way. First, the commit changes all commands and not just the dockerarg build flag, so it may break existing configs. Second, it's too simple: the split can't just check for a \ character, as that might be the last character from an arg.

I prefer to keep the simple split() as is and just to standard url type de-escaping when generating the docker arguments. I.e.:

BuildFlags: dockerargs:KEY1=SPLIT%20VALUE dockerargs:KEY2=VALUE2

Would that also work for you?

cbosdo commented 5 months ago

Closing as an alternative has been merged