Gerard Beekmans gerard at linuxfromscratch.org
Wed Feb 2 07:11:37 PST 2005

On Wed, 2005-02-02 at 07:32, Hui Zhou wrote:
> I shouted several times that validation is unnecessary. Thanks for the 
> example, I will explain.
> 	After parsing, or during parsing, the tool will barf on 
> missing source or destination under copy. He does not need a dtd to 
> tell him, because without source or destination, he wouldn't know how 
> to do it; even say, the dtd (faulty maybe) says its validate, the tool 
> will barf because it doesn't make sense. 

The tools exist to validate already. xmllint is an example. It takes any
XML file with its DTD and tells you "copy is missing the required source
and/or destination." We don't have to write the code for it, it already
exists. Other people will maintain this for us (libxml2 and related
packages) so we only have to use it. Now we can concentrate on creating
the alfs programs (daemon and ui) to do the building only.

Yes it would take time to write a DTD. But it already exists. It won't
take more time today to maintain the XML infrastructure that we already

> 	And for example, the tool takes defaults, the tool work 
> happily with the copy on missing destination if a default destination 
> available, there is nothing wrong there.
> 	Missing destination under copy is not a very common mistake a 
> profile writer will make, make typos in the destination is common. 
> Validation won't help you here.

You are right, it won't solve user error. But it will give a first clue
of "something might be wrong here" to the user running the profiles. A
warning could be shown "missing destination using default of xyz"
telling the user that something might be wrong.

Again, validation of profiles isn't to catch typos and other building
errors. It's just a first line of defense to point out potential issues.
If you forget a close tag you should know about this before attempting
to run a profile. It will either not work or very strange things happen
if a close tag is expected and it never comes, or comes too late.
Validation is meant to make sure the profile is syntactical correct,
typos in filenames are your own responsibility.

It's the same with any compiler. It will tell you if your source code is
syntactical correct but it won't attempt to fix your typos.

Maybe you can look at it this way: The profile is source code. The
validation process is the compiler. Then it is accepted and now a proper
executable piece of code.

Gerard Beekmans

/* If Linux doesn't have the solution, you have the wrong problem */

More information about the alfs-discuss mailing list