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

Re: transitioning config files between two packages

James Vega <jamessan@debian.org> wrote:

> It should just be a matter of removing the files from the old package
> and letting the new ones take their place (with a backup if there are
> any user changes).  A little grepping around in /var/lib/dpkg/info
> turned up this snippet for removing conffiles.
> nagios-plugins.preinst:
> rm_conffile() {
>     CONFFILE="$1"
>     if [ -e "$CONFFILE" ]; then
>         md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
>         old_md5sum="`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $CONFFILE'{s/.* //;p}}\" /var/lib/dpkg/status`"
>         if [ "$md5sum" != "$old_md5sum" ]; then
>             echo "conffile $CONFFILE has been modified by you."
>             echo "Saving as $CONFFILE.dpkg-bak ..."
>             mv -f "$CONFFILE" "$CONFFILE.dpkg-bak"

This violates the spirit of Policy 10.7.3:

"local changes must be preserved during a package upgrade, and" 

and, I think, the word of the next sentence:

"configuration files must be preserved when the package is removed, and
only deleted when the package is purged."

Regards, Frank

Frank Küster
Single Molecule Spectroscopy, Protein Folding @ Inst. f. Biochemie, Univ. Zürich
Debian Developer (teTeX/TeXLive)

Reply to: