feature or useful bug?

Vassili Dzuba vassilidzuba at nerim.net
Sun Jun 22 14:40:34 PDT 2003


On Sun, 22 Jun 2003 07:39:45 +0000 (UTC)
izzyb at ecn.ab.ca (Izzy Blacklock) wrote:

> I've been experimenting with building some new profiles and discovered an 
> unexpected behavior.  I accidently created an entity with the same name as 
> another.  This didn't produce an error or warning as I would have expected.  
> Instead it silently chose the first occurrence of the entity and ignored the 
> future occurrence.  Somehow I don't think this is a _feature_ (at least I 
> don't recall seeing it documented anywhere), but it occurred to me that it 
> could be very useful behavior. 

It's not a bug.

>From the XML spec (http://www.w3.org/TR/REC-xml), section : 4.2

The Name identifies the entity in an entity reference or, in the case of an unparsed entity,
in the value of an ENTITY or ENTITIES attribute. If the same entity is declared more than once,
the first declaration encountered is binding; at user option, an XML processor may issue a warning
if entities are declared multiple times.

> One thing I've been experimenting with is trying to build profiles in such a 
> way that they can be used either on their own, or as building blocks for 
> other profiles.  In this way, a number of profiles from a variety of sources 
> can be used to build a system with the desired features.  My hope is to come 
> up with a system that makes profiles easier to build for specific needs and 
> more practice to share with others.  One problem that I've run into is how to 
> make a small change to a profile for a specific need, without needing to 
> duplicate and modify the original.
> For instance, what if I want to load Grub instead of lilo (I don't, this is 
> just an example) using Naven's LFS4.0 profile included with nALFS?  To avoid 
> duplicating and modifying the whole profile, I would create an alternate for 
> LFS-4.0.xml, so I could create an alternate for entities/system, so I could 
> specify an alternate for chapter6/lilo.xml to either load grub instead or do 
> nothing if I had an different profile loading grub.
> If I take advantage of this _bug_, all I need to do is create an alternate for 
> LFS-4.0.xml (which I'm doing already so I can load other profiles) and load 
> an entity which override anything I need to change, before loading the 
> standard profile entities.  Besides being simpler, this approach isn't likely 
> going to need modifying when you change to the LFS-4.1 profile once it comes 
> out.
> So, why am I telling you all this?  Well, besides hoping it is usefull to 
> others, I want to make sure that this _bug_ is considered a _feature_ in 
> future development.  ie, I'd hate to see it get fixed! :)  It may be usefull 
> however to cause a warning to be displayed unless a command line flag is set 
> to ignore them.  That way, people wont get bitten if they accidently 
> duplicate an entity name like originally happened to me.  It took my a little 
> while to track down the problem when things weren't working as I expected! :(  
> ...Izzy
> PS: I plan to eventually make my profiles available to anyone who is 
> interested.  I'm currently working on an LFS-4.1 profile which uses this 
> technique to override Naven's LFS-4.0 profile.  I'm installing a system with 
> it right now. If all goes well, I'll make it available by request until I get 
> around to putting up a web site it can call home.
> -- 
> Unsubscribe: send email to listar at linuxfromscratch.org
> and put 'unsubscribe alfs-discuss' in the subject header of the message

Vassili Dzuba
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe alfs-discuss' in the subject header of the message

More information about the alfs-discuss mailing list