Bug #605 -- Conditional execution

James Robertson jwrober at linuxfromscratch.org
Sun Feb 1 19:49:57 PST 2004


Kevin P. Fleming wrote:
> Gerard Beekmans wrote:
> 
>> So, my question to you guys is: what will it take to get this feature
>> implemented? I can justify spending work hours on this, to a certain
>> degree, so I'm perfectly willing to help out implementing it. However,
>> my coding skills aren't up to snuff with what you'd expect to see
>> quality wise, so I'm not sure I could pull it off properly.
> 
> OK, I have begun working on this, I'm about 30% of the way there. I have 
> some issues for the group, though:
> 
> - was <if>/<then>/<else> support added in DTD 3.1 or 3.0? I am adding it 
> to nALFS and allowing it be used to match the 3.1 DTD (even though James 
> as already removed it from the 3.1 syntax document), but I need to know 
> if it was in the 3.0 DTD as well.

The v3.1 DTD does not even have <if>, <then>, <else> in it anywhere. 
hence the reason I removed them from the syntax doc.  Kinda difficult to 
document something that does not exist.  So, I think the info in the doc 
was out of place and those elements do not exist anywhere yet.  I am 
thinking you are going to need them in v3.2 and up.

> 
> - I'm not keen on the <if> syntax at all... it seems cumbersome and will 
> be hard to extend in the future. For DTD 3.2, I'd like to propose the 
> following:
> 
> <if>
>   <test>0/1/true/false/yes/no</test>
>   <and>
>     <or>
>       <test>"shell test function expression"</test>
>       <package-built>package-name</package-built>
>     </or>
>     <package-version condition="eq">3.1.2</package-version>
>   </and>
>   <then>
>     ...
>   </then>
>   <else>
>     ...
>   </else>
> </if>

I like this scenario.  Looks clean and easy to follow.  What would all 
of the condition ATTLIST's be?  Same as what bash offers now?
> 
> Well, the logic there is bogus, but you see the point: add <and>/<or> 
> elements to construct boolean logic (multiple conditions inside <if> 
> would be implicitly <and>ed) and provide 
> <test>/<package-built>/<package-version> tests. This allows for future 
> extensibility, is easier syntax to use and can be used for more complex 
> tests than the existing syntax.
> 
> Thoughts?
> 
James



More information about the alfs-discuss mailing list