[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Config file management utility



On Thu, 4 Dec 1997, Joey Hess wrote:

> Some things to look out for, though:
> 
> - if the file alter-file is a conffile, there will be problems later when
> you upgrade the package containg the conffile.

I'm not sure I follow what you're getting at.

The way I'm thinking, if a package (say, cron) was going to use this
hypothetical tool to manage /etc/crontab, say... then it wouldn't have a
crontab in the /etc directory of the .deb file. It would, instead, have a
copy of the _snippet_it_wants_to_contribute_to_the_config_file somewhere
like /usr/lib/cron/crontab.snippet or something. Then, the actual
creation/ateration of /etc/crontab would be done with the tool... invoked
from, say, postinst. So, instead of having an /etc/crontab in the .deb
archive, postinst would have something like:

   alter-file /etc/crontab --package=cron < /usr/lib/cron/crontab.snippet

The pitfall I'm forseeing (which doesn't seem to me to be the same one
you're thinking of), is what happens the first time we upgrade a package
that has now switched over to using this new tool? The new tool will be
looking for its BEGIN and END markers for that package when there won't be
any. I guess there's no crime in having the tool just stomp on the
previous version of the file since that's what dpkg would do (but giving
the user the 'ol Y,N,I,O,Z choices).

> - you have to consider what happens if alter-file is asked to modify a file
> that does not yet exist, becuase the package it is in has not been installed
> yet.

I had assumed that the default behavior would be that the file would be
created right then and there. In fact, I'm having enough trouble forseeing
a case where you would NOT want this to happen, I'm debating whether to
even bother putting in a command-line switch to turn that behavior off.

- Joe



--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: