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

Re: Managing configuration files



Mark Shuttleworth writes:
> 
>   1. Debian keeps track of files in debian.conffiles, and knows if
>      they have been modified.  As a developer, how do I ask it if
>      a file has been modified?

if [ `cat /var/lib/dpkg/status | grep $file | awk {'print $2'}` = \
	`md5sum $file | awk {'print $1'}` ]
should do the trick.  Untested of course ;)
There might be a better way.

>   2. What is the best strategy for managing config file upgrades.

Use dpkg.

>      Are these automatically copied over existing files when the
>      upgrade occurs?  

No.  If the user hasn't changed the files from the distributed copy
then they're copied over.  If the user has changed things, then 
if the distributed copies haven't changed, nothing happens.  If the
distributed copies have changes, there is a prompt, and the files
are usually both left there.

>      Should I back up existing files in
>      debian.preinst?  Should I put the files temporarily in /tmp
>      and then selectively move them into /etc/httpd/ if they
>      are needed?

Most certainly not.  That's why we have dpkg ;)

Is this documented somewhere, or am I losing my mind?
I s'pose they could both be true ;)

-- 
Carl Streeter                   |  "Etiquette-wise, there is no proper time 
streeter@cae.wisc.edu           |    to use the phrase 'It sucks.'" --Dogbert
Just another Perl hacker        |  "I'm a heartless bastard." --Linus Torvalds
Ask me about Debian/GNU Linux.  |    http://www.cae.wisc.edu/~streeter/


Reply to: