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

Re: [PATCH] add dpkg-conffile, based upon http://wiki.debian.org/DpkgConffileHandling



Joey Hess wrote:
As discussed on debian-devel, different versions of these conffile handling
shell functions on the wiki are being copied into maintainer scripts
repeatedly, and adding a program to dpkg that handles things is a more
maintainable approach.


It was discussed briefly on debian-devel, but there is also the case that the backup files should be cleaned up on purge.

What about something like

# Purge backup conffile
rm_backup_conffile()
{
    CONFFILE="$1"
    if [ -e "$CONFFILE".dpkg-bak ]; then
        echo "Purging backup of conffile $CONFFILE"
        rm -f "$CONFFILE".dpkg-bak
    fi
}

and in postrm

case "$1" in
purge)
	dpkg-conffile rm_backup /etc/pkg.conf
	;;
esac

(Scott will know this code, we already use something like that in the upstart package)

Cheers,
Michael

P.S: CC on replies. I'm not subscribed.
--
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: