]> git.michaelhowe.org Git - packages/m/munin-plugins-local.git/commitdiff
Add postinst and prerm to dpkg-divert unbound_munin_
authorMichael Howe <michael@michaelhowe.org>
Thu, 21 Dec 2017 18:33:43 +0000 (18:33 +0000)
committerMichael Howe <michael@michaelhowe.org>
Thu, 21 Dec 2017 18:33:43 +0000 (18:33 +0000)
This plugin is shipped in unbound in stretch, which causes a bunch of
issues.

Eventually, we should remove the plugin (and the divert) from here.

debian/changelog
debian/postinst [new file with mode: 0644]
debian/prerm [new file with mode: 0644]

index 24284a13bf576e78e532aff913f6543c41731405..ed040b817ed8effcee51949bc8c3b8894cfc8429 100644 (file)
@@ -1,6 +1,9 @@
-munin-plugins-local (0.10~test.3) UNRELEASED; urgency=medium
+munin-plugins-local (0.10~test.4) UNRELEASED; urgency=medium
 
   * Add lvmcache_ plugin, for graphing lvm cache state 
+  * Add prerm and postinst to handle duplication of unbound_munin_ (also
+    provided by unbound in stretch).  Eventually we should move to that
+    plugin, but not until we're on stretch everywhere.
 
  -- Michael Howe <michael@michaelhowe.org>  Sat, 16 Dec 2017 22:12:26 +0000
 
diff --git a/debian/postinst b/debian/postinst
new file mode 100644 (file)
index 0000000..bd9d5d9
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = configure ]; then
+    DEBIAN_VERSION=$(sed -e 's/\..*//' /etc/debian_version)
+    if [ $DEBIAN_VERSION -gt 8 ]; then
+        # for stretch and above unbound includes the unbound_munin plugin itself
+        dpkg-divert --add --package munin-plugins-local --rename --divert /usr/share/munin/plugins/unbound_munin_.distrib /usr/share/munin/plugins/unbound_munin_
+    fi
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/prerm b/debian/prerm
new file mode 100644 (file)
index 0000000..b028e1a
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = remove ]; then
+    DEBIAN_VERSION=$(sed -e 's/\..*//' /etc/debian_version)
+    if [ $DEBIAN_VERSION -gt 8 ]; then
+        # for stretch and above unbound includes the unbound_munin plugin itself
+        dpkg-divert --remove --package munin-plugins-local --rename --divert /usr/share/munin/plugins/unbound_munin_.distrib /usr/share/munin/plugins/unbound_munin_
+    fi
+fi
+
+#DEBHELPER#
+
+exit 0