lrm/exluded/protected rewrite
Auke Kok
sofar at lunar-linux.org
Sun Mar 14 23:04:41 GMT 2004
Hi all,
I've just committed a basic rewrite of lrm. excerpt from the commit:
Major lrm/exluded/protected rewrite:
- allow re's in excluded/protected
- true protected directories with recursion
- excluded ONLY contains stuff that we DO NOT WANT TO SEE in the install
logs
- lvu alien adjusted too
- track() function adjusted and simplified
- removed unneeded lrm tmpfiles and loops, simplified
this will mean that (for theedge for now) you will have a different
approach for protecting files from deletion. I will hope to clarify this
so everyone understands how to use this in their modules:
the basic concepts are these:
1) we *want* to see as MANY files as possible in the install logs
2) we don't want special logfiles to be deleted UNLESS
* they were identical to the default installed version
AND
* they were not changed by the SA
this results in the following:
/excluded contains only directories we do never want to see in the
install logs since they are compile and/or intermediate files (or
otherwise completely unrelated to the install process itself
(example:/root/.distcc -> hence ^/root/ is now in the new excluded file)
HOWEVER
having /etc/foo.conf in the install logs of module foo is not a bad
thing, unless it gets removed accidentally. There are 2 (TWO) ways of
preventing this:
THE GOOD WAY:
1) have the BUILD install a default foo.conf only if /etc/foo.conf
doesn't exist. If the user edits it, then the md5sum will mismatch and
it won't get removed. If the user doesn't edit it, he likes the default
and should (and will) get the new default cos the md5sum matches, lrm
removes it, and lin installs a new default.
THE UGLY WAY:
2) make sure it never gets deleted. Add ^/etc/foo.conf to "protected".
WHEN TO USE OPTION 2:
if the module itself during BUILD touches the conf files (so they will
end up in the install logs automatically - even if they weren't changed
at all)
so... what's new?
well you can now enter FULL grep regex's into /var/lib/lunar/protected,
and I prefer you really do it like the following examples:
: protect an entire directory recursively:
^/etc/X11/
: protect all files named "fonts.dir" :
/fonts.dir$
: protect a sigle file and/or all files starting the same way:
^/usr/bin/dirname
note that the last one also protects /usr/bin/dirnames, right now we
don't care since this was always the case anyway, but it would be
syntactically better to write it like: ^/usr/bin/dirname$ of course.
WHY THIS WAY?
well we were missing some features in lrm: recursive protected depends,
protect specific files in whatever directory they are! (fonts.dir for
example).
hopefully everyone gets the point here, let me know if there's any
problem with docs/modules...
sofar
More information about the Lunar-dev
mailing list