From: Sebastian Harl Date: Mon, 7 Jun 2010 22:16:53 +0000 (+0200) Subject: collectd.postinst: Manually replace /u/s/d/collectd/examples/ with a symlink. X-Git-Tag: collectd-4.10.0-1~3 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=48e6c59482ad9c7745519388b970e6ebc010886d;p=pkg-collectd.git collectd.postinst: Manually replace /u/s/d/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 --- 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.