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

Re: May packages rm -rf subdirectories of /etc/ ?

On Thu, 2003-07-24 at 08:47, Andreas Metzler wrote:
> It really sucks to handle this if you want/need to get rid of it (if
> it is unmodified) not only on purge but on upgrades. - You'll need
> if [ "$1" =  "configure" ] && \
>         dpkg --compare-versions "$2" le-nl "1.2.3" && \
>         [ -e /etc/foo ] && \
>         [ `md5sum /etc/foo | cut -d\  -f1` = "6bea09fbb18e4676012105fa5fc726c6" ]
> then
>         echo "Removing orphaned unmodified configfile /etc/foo" 1>&2
>         rm /etc/foo
> fi

In a discussion that followed from this thread off-list, some
people agreed that the administrator should be asked what
he or she wants to do with an obsolete conffile.  The conffile
should not be deleted silently because other packages may be
using the file.

Here is how I see it.  On install of the new version of foo
which lacks the former foo conffile /etc/foo.conf,

* dpkg informs the user that /etc/foo.conf is no longer a
  conffile of foo;
* dpkg says whether or not /etc/foo.conf was changed from the
* dpkg offers to display the file, to start a shell so that
  the user can check things out, or to do one of three things
  to the file:
  * leave the file as it is (= the current behavior),
  * delete the file (= the default if the file has not been changed),
  * rename the file to /etc/foo.conf.dpkg-old (= the default if
    the file has been changed)


Reply to: