[VOTE] Re: directory-handling with nALFS

Kevin P. Fleming kpfleming at linuxfromscratch.org
Fri Apr 2 22:14:40 PST 2004


Reinhard wrote:

> That's right. But in that case, the mkdir will raise an error, which is the 
> same behaviour than today (may be need some additional investigation).
> Although the benefit seems to be little, I think, it is better than using the 
> *parents* option, where it is not in the book.

Well that's the relevant issue right there: should the official LFS 
profile be _exactly_ the same as the book, or should it take advantage 
of minor differences that make it work more efficiently or be more 
configurable?

Realistically, if the profile is supposed to _match_ the book (i.e. no 
parents option), then the error should be raised, because it would be 
raised if the user was typing in the commands from the book and tried to 
mkdir a directory that already existed.

If, on the other hand, the user wants their profile to be able to be 
re-run without causing problems, I personally much prefer that they 
specifically indicate that they want each individual mkdir to be able to 
succeed in the case of an existing directory, rather than setting some 
global option that makes them _all_ do that. Doing otherwise violates 
the principle of Least Astonishment; if someone has set that option, and 
then along comes some new part of the book that _mandates_ that a 
particular directory and its contents should be recreated if the profile 
gets re-run, that will not happen and the user won't realize it because 
the failure has been silently suppressed. Granted this is not a very 
likely scenario, but it does exist.

Certainly the use of the "parents" option is not an obvious way to 
document that a particular mkdir element should ignore an existing 
directory, but it's what we have today and it's compatible with all 
other ALFS implementations. Implementing something in nALFS that allows 
the official profile to work differently that in any other ALFS 
implementation is not a good solution.

As it stands today, any user who wishes can very easily copy the mkdir.c 
handler source code, add a new option to specify that mkdir should 
ignore existing directories, and set the "priority" field so their 
customized mkdir handler gets used instead of the standard one. I know 
that this is not documented anywhere except in the mailing list archives 
at this point, but that's because James and I have had more important 
things to do than work on the nALFS hacker's guide :-) For the future, 
this will be a very common way for people to "tweak" the handlers to do 
what they want, but they will have to know that by doing so their 
profiles become (even slightly) incompatible with any standard ALFS 
implementation.



More information about the alfs-discuss mailing list