regarding appending to config-files
bdumm at bobby.bcpub.com
Thu Mar 1 08:07:37 PST 2001
On Thursday 01 March 2001 20:43, you wrote:
> First I would apologise in advance if the following already has been
> discussed and desided upon. I've not seen this in the archives, but you
> never knows....
:) Nope no comments on it yet.
> Since my last post I've downloaded the profile posted by Nicholas Dille and
> tested this on the same machine that my own profilen bombs out on and
> Nicholas' profile works like a charm. Haven't quite figured out why yet,
> but that can wait. Running through the profile I'm left with two questions
> that I can't really figure out.
Yea it should, as there is not two chroot object like in the profile
you were using.
> 1) How to handle the compiling of the kernel. I guess I'm missing
> something obvious due to my lack of experience with linux, but my
> understanding was that if the symlinks created in chap5 was done, I could
> copy a .config from another 2.4.2 kernel, run make dep and friends. Please
> correct me if I'm wrong.
Yes the .config you create from make config, menuconfig, xconfig is just
the same text file in the end. So you could put into a profile all those
normal commands/procedures you use to do everything but the actual
.config creation part. Considering that .config is just another format as well
I think we could even do that part here soon. Would make a nice frontend
feature, me thinks...
> 2) How to handle additions to already existing config-files. I started to
> wonder how to add info to lilo.conf that is copied from the existing
> system. If textdump can be extended to handle appending as well this could
> be solved quite easy. Since my perl isn't "fluid" I'll try to describe in
> "pseudocode" :
> - adding a attribute named mode with either create or append as
> valid values to the textdump-tag and then add the following to
> if file does exit AND mode = append
> open file for append
> dump new data to file
> create file
> dump data to file
> So I'm I way off on this or is there some sense to this ??
Yea in perl when you open a file you can add >> to your open and
that will either append to existing file or create new file if it doesn't
exist and append to that new file.
You can do basic textdumps, we should add the append feature to
textdump, and you also have the <search_replace> element. That is
basic s/// type regex.
I think as we get into config files more we will want additional regex type
commands, but that hasn't been explored really....
More information about the alfs-discuss