[Piuparts-devel] Bug#588313: piuparts: needs to detect changes in diversions
Andreas Beckmann
debian at abeckmann.de
Wed Jul 7 09:58:23 UTC 2010
Package: piuparts
Version: 0.38
Severity: normal
Hi,
piuparts does not detect changes to the diversions (done with
dpkg-divert) that remain after purging (usually a forgotten removal ...)
I currently use the following two hook scripts to do this checking, but
I think this could be solved more elegant internally. The
/var/lib/dpkg/diversions file is easily parsable (but the order of the
records may change when diversions are added and removed).
BEGIN post_setup_90-save-diversions:
#!/bin/sh
set -e
dpkg-divert --list | sort > /tmp/.piuparts.diversions.initial
END post_setup_90-save-diversions
BEGIN post_purge_90-check-diversions:
#!/bin/sh
set -e
dpkg-divert --list | sort > /tmp/.piuparts.diversions.final
if ! cmp -s /tmp/.piuparts.diversions.initial /tmp/.piuparts.diversions.final
then
echo "ERROR: diversions have changed"
diff /tmp/.piuparts.diversions.initial /tmp/.piuparts.diversions.final
exit 1
fi
rm /tmp/.piuparts.diversions.final
END post_purge_90-check-diversions
Andreas
-- System Information:
Debian Release: squeeze/sid
APT prefers stable
APT policy: (800, 'stable'), (700, 'testing'), (600, 'unstable'), (130, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages piuparts depends on:
ii apt 0.7.25.3 Advanced front-end for dpkg
ii debootstrap 1.0.23 Bootstrap a basic Debian system
ii lsb-release 3.2-23.1 Linux Standard Base version report
ii lsof 4.81.dfsg.1-1 List open files
ii python 2.6.5-5 An interactive high-level object-o
ii python-debian 0.1.16 Python modules to work with Debian
piuparts recommends no packages.
Versions of packages piuparts suggests:
ii ghostscript 8.71~dfsg2-3 The GPL Ghostscript PostScript/PDF
pn python-rpy <none> (no description available)
-- no debconf information
More information about the Piuparts-devel
mailing list