Bug #605 -- Conditional execution

Kevin P. Fleming kpfleming at linuxfromscratch.org
Sat Jan 31 16:04:22 PST 2004


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.

- 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>

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?




More information about the alfs-discuss mailing list