From 48e6c59482ad9c7745519388b970e6ebc010886d Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Tue, 8 Jun 2010 00:16:53 +0200 Subject: [PATCH] collectd.postinst: Manually replace /u/s/d/collectd/examples/ with a symlink. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit … when upgrading from versions << 4.10.0-1~ -- this is not handled by dpkg according to policy 6.6. Thanks to Joey Hess for reporting this! Closes: #569268 --- debian/changelog | 7 ++++++- debian/collectd.postinst | 11 +++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 963cbd8..9e9293e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -20,8 +20,13 @@ collectd (4.10.0-1) unstable; urgency=low - Define (and pass to configure) $JAR. - Added support for Renesas SH4 to the Java arch mapping; thanks to Nobuhiro Iwamatsu for the patch (Closes: #564165). + * debian/collectd.postinst: + - Manually replace /usr/share/doc/collectd/examples/ with a symlink when + upgrading from versions << 4.10.0-1~ -- this is not handled by dpkg + according to policy 6.6; thanks to Joey Hess for reporting this + (Closes: #569268). - -- Sebastian Harl Thu, 03 Jun 2010 17:04:44 +0200 + -- Sebastian Harl Tue, 08 Jun 2010 00:14:50 +0200 collectd (4.9.1-2) unstable; urgency=low diff --git a/debian/collectd.postinst b/debian/collectd.postinst index 8fe5048..99bfabf 100644 --- a/debian/collectd.postinst +++ b/debian/collectd.postinst @@ -25,6 +25,17 @@ if [ -x "/etc/init.d/collectd" ]; then fi fi +# replace the directory provided by older versions of the package with a +# symlink; dpkg does not handle that according to policy 6.6 +if [ "$1" = "configure" ] \ + && dpkg --compare-versions "$2" lt-nl "4.10.0-1~"; then + if [ -d "/usr/share/doc/collectd/examples" ]; then + ! rmdir /usr/share/doc/collectd/examples > /dev/null 2>&1 \ + || ln -s ../collectd-core/examples \ + /usr/share/doc/collectd/examples + fi +fi + # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. -- 2.30.2