Re: May packages rm -rf subdirectories of /etc/ ?
Stephen Zander <email@example.com> wrote:
>>>>>> "Herbert" == Herbert Xu <firstname.lastname@example.org> writes:
>> Unfortunately dpkg does not handle the case where a
>> conffile ceases to exist in a later version of a package.
>> The conffile will be left on the system even after
> That's why packages have maintainers and postrm scripts.
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" ]
echo "Removing orphaned unmodified configfile /etc/foo" 1>&2
And not only one of these, but one for every version of /etc/foo you
ever shipped (you want to provide smooth upgrades from 1.2.3, 4.5.6
dpkg OTOH does know the md5sum of the last (un)installed version and
does not need a hard-coded lists in postinst.