[Buildbot-devel] Blank properties
Georges Racinet
gracinet at anybox.fr
Thu Jun 7 23:29:56 UTC 2012
On 06/07/2012 10:25 PM, Fredric Dorothy wrote:
> I have a question about property defaults. From the documentation I
> found that I can do something like this:
>
> f.addStep(ShellCommand(command=[ 'foo', Property('bar', default='') ]))
>
> What I would like to happen is for command to be ['foo'] when the
> property bar is not defined. However, command turns out to be ['foo',
> ''], and that causes the script 'foo' to think it has an extra
> argument passed to it.
I've had the same problem, too. Fortunately, in my case, I could set an
environment variable instead of a passing an argument, and that had the
wished behaviour if empty.
Worse : how to issue ['foo', '--option=value_from_prop'] or just ['foo']
? And about ['foo', '-o', 'value_from_prop'] ?
I guess for these cases an auxiliary script cannot be avoided without
utter complication.
> Is there an easy way to remove empty strings from the command list
> during the build? Wouldn't it make sense to have the command list
> automatically remove empty strings as the default behavior?
I don't know any program that gives a special meaning to empty
arguments. If some people consider this to be an issue, we could use
None, or a special marker instead of '', to the same effect.
Regards,
--
Georges Racinet
Anybox SAS, http://anybox.fr
More information about the devel
mailing list