[wpkg-users] nested check logic

Rainer Meier r.meier at wpkg.org
Sun Dec 14 20:04:03 CET 2008


Hi Chris,

W. Chris Shank wrote:
> does WPKG support nested check condition logic? for instance - something
> like this:
> 
> check type=logical condition=or
>   check file A exists
>   check file B exists
>            check type=logical condition=and
>                      check file=C exists
>                      check file=D exists
> 
> so in order for the condition to return true - files C and D would both
> be needed and either A or B
> 
> I'm asking because I'm working on an interface to build packages and
> associate them to machines and profiles in such a way that it will make
> managing a large number of machines much easier. the logic for
> manipulating the check conditions is a little tricky so before i go
> through all the hassle of coding it I want to make sure the resultant
> XML is going to be parsed correctly. if WPKG only supports one level of
> logic that's OK too. i just don't want to waste time on the interface if
> its not supported.

In your case "check type=logical condition=and" seems to be a sub-check
of "check type=logical condition=or". So either A, B or C & D needs to
be true in order to yield true at the end.

WPKG supports multiple levels of logical checks. In your case it first
evaluates A, if A is true then all following checks can be skipped
(return will be true).

If A is false it evaluates B and stops if B is true.

If A and B all were false, then it evaluates C and D and both need to
yield ture in order to yield true to the upper logical check.

br,
Rainer



More information about the wpkg-users mailing list