[wpkg-users] New condition not working as expected
Rainer Meier
r.meier at wpkg.org
Sun Oct 23 02:37:23 CEST 2011
Hi Stefan,
On 23.10.2011 02:17, Rainer Meier wrote:
> Looking at the code the logical "not" check allows only one single check
> sub-node. However the XSD allows to specify as many check sub-nodes as you want.
>
> Well; I think I am going to extend the code to assume an implicit "and" when
> multiple sub-nodes are specified. So if any of the checks fail the result of the
> checks will be "false" and due to the "not" condition it will return "true".
>
> Currently you should actually see an error in the log:
>
> Check condition 'not' requires one and only one child check condition. Instead x
> childs have been found.
Just committed support for multiple check sub-nodes in NOT conditions:
Changes 2011-10-22, v1.2.1-RC37 by Rainer Meier <r.meier (at) wpkg.org>
NEW: Allowing multiple checks in logical "NOT" check. If multiple checks are
specified, then the checks are "And-linked" which means that in case any
of the sub-checks fails, then the result is "true". If all checks succeed,
then the result is "false".
Example:
<check type="logical" condition="not">
<check type="host" condition="hostname" value="HOSTNAME"/>
<check type="host" condition="os" value="5\.0\.\d{4}"/>
</check>
The check will be false only if the host is named HOSTNAME and runs OS
version 5.0.x (Windows 2000).
If the OS version does not match or the hostname is different, then the
result is true, no matter which of the checks (or all) fail.
Thanks to Stefan Pendl for reporting the inconsistency between
implementation and XSD.
It's been quickly tested in my lab environment.
Please note that I've just moved the files within the repository to use another
build system. More details will follow on next release I think.
You can find the latest wpkg.js here:
<http://wpkg.svn.sourceforge.net/viewvc/wpkg/wpkg/stable/src/main/resources/wpkg/>
br,
Rainer
More information about the wpkg-users
mailing list