<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On Mar 31, 2006, at 9:02 AM, Ludwig Nussel wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Stéphane Peter wrote:</DIV> <BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">[...]</DIV> <BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">You could also just use xml to represent that expression. You don't</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">need an additional parser then.</DIV> </BLOCKQUOTE><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Good point, although I tend to prefer simple strings to replace the <SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">existing system in place, which was already a string with a command <SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">to call. We would also have to worry about children XML nodes in many <SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">places where we didn't expect much more than attributes before, which <SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">would complicate things further and certainly introduce more bugs. ;)</DIV> </BLOCKQUOTE><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">It would be the same. If I understand your description correctly you</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">do &lt;bool name="foo"&gt;+(|(redhat,suse),x86)&lt;bool&gt;. If you use xml</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">instead it would be something like</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">&lt;bool name="foo"&gt;</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">  </SPAN>&lt;and&gt;</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">    </SPAN>&lt;or&gt;</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">      </SPAN>&lt;distro&gt;redhat&lt;/distro&gt;</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">      </SPAN>&lt;distro&gt;suse&lt;/distro&gt;</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">    </SPAN>&lt;or&gt;</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">    </SPAN>&lt;arch&gt;x86&lt;/arch&gt;</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">  </SPAN>&lt;/and&gt;</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">&lt;bool&gt;</DIV></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Well, actually you didn't understand my description correctly. ;) You would have something like this:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>&lt;bool name="foo" script="command.sh"/&gt; (the return value from the command determines the bool  value).</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>You can then use expressions referencing these bools in other current tags, for example :</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>&lt;files if="+(foo,Linux)"&gt;</DIV><DIV>  file1</DIV><DIV>  file2</DIV><DIV>  ...</DIV><DIV>&lt;/files&gt;</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>So my point was that it would add a lot to the syntax of these existing tags to do it in XML the way you suggest. Sure we could do it, but I like simplicity.</DIV><BR><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Not exactly the most compact way to define an expression but it fits</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">better into the rest of the file.</DIV></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV>We could do it, but I don't think it is really necessary, at least not for now. The whole parser is only a hundred lines or so.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>These changes help to write much cleaner installers. I have made a few more changes over the past couple of days, and have greatly simplified a very complex installer script I am using in a shipping product. It also improves performance as it can be used to reduce the number of external scripts being called to a minimum. A lot of the previous conditional tags were calling commands every time they were being parsed.</DIV></DIV><BR><DIV> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">--</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">Stéphane Peter</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica"><A href="mailto:megastep@megastep.org">megastep@megastep.org</A></FONT></P>  </DIV><BR></BODY></HTML>