]> git.michaelhowe.org Git - packages/n/nagios-plugins-local.git/commitdiff
Add preinst/postrm to run dpkg-divert for check_running_kernel
authorMichael Howe <michael@michaelhowe.org>
Mon, 16 Sep 2019 19:28:53 +0000 (20:28 +0100)
committerMichael Howe <michael@michaelhowe.org>
Mon, 16 Sep 2019 19:28:53 +0000 (20:28 +0100)
We want to override the version from nagios-plugins-contrib, at least
until they fix the bug.

debian/nagios-plugins-local-client.postrm [new file with mode: 0644]
debian/nagios-plugins-local-client.preinst [new file with mode: 0644]

diff --git a/debian/nagios-plugins-local-client.postrm b/debian/nagios-plugins-local-client.postrm
new file mode 100644 (file)
index 0000000..5ba9d69
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+if [ "remove" = "$1" -o "abort-install" = "$1" -o "disappear" = "$1" ]; then
+    dpkg-divert --remove --package nagios-plugins-local-client --rename --remove /usr/lib/nagios/plugins/check_running_kernel
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/nagios-plugins-local-client.preinst b/debian/nagios-plugins-local-client.preinst
new file mode 100644 (file)
index 0000000..68d8159
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+
+add_diversion() {
+    dpkg-divert --add --package nagios-plugins-local-client --rename --divert /usr/lib/nagios/plugins/check_running_kernel.distrib /usr/lib/nagios/plugins/check_running_kernel
+}
+
+if [ "upgrade" != "$1" ] || dpkg --compare-versions "$2" lt "0.20"; then
+    add_diversion
+fi
+
+#DEBHELPER#
+
+exit 0