Discussion:
[wpkg-users] conditions are not nestable in includes
h***@horiba.com
2016-02-24 11:08:43 UTC
Permalink
Hello,

i tried the following:

<command type='condscript' cmd='mycommand1'>
<condition>
<somecheck2>
</condition>
</command>
<command type='condscript' cmd='mycommand2'/>
<command type='install' include='condscript'>
<condition>
<somecheck1>
</condition>
</command>

What I expected:
'mycommand1' should only fire when 'somecheck1' is true AND 'somecheck2'
is true (because 'condscript' should only be included when 'somecheck1' is
true).
'mycommand2' should fire afterwards (if somecheck1 is true)

with somecheck1 = 1 false and somecheck2=true that should result in no
commands being fired.

What actually happened: (with somecheck1 = false and somecheck2 = true)
'mycommand1' was fired
'mycommand2' was not fired.

So it looks like conditions can not be nested inside includes. Conditions
are always globally resolved.

Looking at the logs confirms this: 'condscript' is not included, but
'mycommand1' is fired anyway.

Did I get that right? Is this intended behaviour?

Best Regards
Heiko

Loading...