[Pkg-nagios-devel] Bug#659548: check-mk: multiple bugs in dpkg-maintscript-helper use
Colin Watson
cjwatson at ubuntu.com
Sun Feb 12 00:10:22 UTC 2012
Package: check-mk
Version: 1.1.12-1
Severity: normal
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch precise
There are multiple bugs in your use of dpkg-maintscript-helper, which
render it unreliable on upgrades. Here's a patch to fix them. I would
suggest migrating to dh_installdeb's .maintscript files in future,
though, as it reduces repetition and thus makes it harder to get this
kind of thing wrong.
* Move dpkg Pre-Depends from check-mk-server to check-mk-config-icinga and
check-mk-config-nagios3, to match the packages that actually use
dpkg-maintscript-helper.
* Remove package names from dpkg-maintscript-helper calls. They were
unnecessary and had an incorrect trailing dot.
* Move check-mk-config-nagios3.prerm to check-mk-config-nagios3.preinst.
'dpkg-maintscript-helper mv_conffile' is ineffective in the prerm.
diff -u check-mk-1.1.12/debian/check-mk-config-icinga.postrm check-mk-1.1.12/debian/check-mk-config-icinga.postrm
--- check-mk-1.1.12/debian/check-mk-config-icinga.postrm
+++ check-mk-1.1.12/debian/check-mk-config-icinga.postrm
@@ -5,8 +5,7 @@
dpkg-maintscript-helper mv_conffile \
/etc/icinga/objects/check_mk_templates.cfg \
/etc/icinga/objects/check_mk/check_mk_templates.cfg \
- 1.1.10-2 \
- check-mk-config-icinga. -- "$@"
+ 1.1.10-2 -- "$@"
#DEBHELPER#
diff -u check-mk-1.1.12/debian/control check-mk-1.1.12/debian/control
--- check-mk-1.1.12/debian/control
+++ check-mk-1.1.12/debian/control
@@ -39,7 +39,6 @@
Package: check-mk-server
Architecture: any
-Pre-Depends: dpkg (>= 1.15.7.2)
Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, python, check-mk-config-nagios3 | check-mk-config-icinga
Recommends: check-mk-doc
Description: general purpose nagios-plugin for retrieving data
@@ -55,6 +54,7 @@
Package: check-mk-config-icinga
Conflicts: check-mk-config-nagios3
Architecture: any
+Pre-Depends: dpkg (>= 1.15.7.2~)
Depends: ${shlibs:Depends}, ${misc:Depends}, adduser
Description: general purpose nagios-plugin for retrieving data
Check_mk adopts a new a approach for collecting data from operating systems
@@ -68,6 +68,7 @@
Package: check-mk-config-nagios3
Architecture: any
+Pre-Depends: dpkg (>= 1.15.7.2~)
Depends: ${shlibs:Depends}, ${misc:Depends}, adduser
Conflicts: check-mk-config-icinga
Description: general purpose nagios-plugin for retrieving data
diff -u check-mk-1.1.12/debian/check-mk-config-icinga.postinst check-mk-1.1.12/debian/check-mk-config-icinga.postinst
--- check-mk-1.1.12/debian/check-mk-config-icinga.postinst
+++ check-mk-1.1.12/debian/check-mk-config-icinga.postinst
@@ -19,8 +19,7 @@
dpkg-maintscript-helper mv_conffile \
/etc/icinga/objects/check_mk_templates.cfg \
/etc/icinga/objects/check_mk/check_mk_templates.cfg \
- 1.1.10-2 \
- check-mk-config-icinga. -- "$@"
+ 1.1.10-2 -- "$@"
if [ -e '/etc/icinga/objects/check_mk_objects.cfg' ];
then
diff -u check-mk-1.1.12/debian/check-mk-config-nagios3.postinst check-mk-1.1.12/debian/check-mk-config-nagios3.postinst
--- check-mk-1.1.12/debian/check-mk-config-nagios3.postinst
+++ check-mk-1.1.12/debian/check-mk-config-nagios3.postinst
@@ -19,8 +19,7 @@
dpkg-maintscript-helper mv_conffile \
/etc/nagios3/conf.d/check_mk_templates.cfg \
/etc/nagios3/conf.d/check_mk/check_mk_templates.cfg \
- 1.1.10-2 \
- check-mk-config-nagios3. -- "$@"
+ 1.1.10-2 -- "$@"
if [ -e '/etc/nagios3/conf.d/check_mk_objects.cfg' ];
then
diff -u check-mk-1.1.12/debian/check-mk-config-nagios3.postrm check-mk-1.1.12/debian/check-mk-config-nagios3.postrm
--- check-mk-1.1.12/debian/check-mk-config-nagios3.postrm
+++ check-mk-1.1.12/debian/check-mk-config-nagios3.postrm
@@ -6,6 +6,5 @@
/etc/nagios3/conf.d/check_mk_templates.cfg \
/etc/nagios3/conf.d/check_mk/check_mk_templates.cfg \
- 1.1.10-2 \
- check-mk-config-nagios3. -- "$@"
+ 1.1.10-2 -- "$@"
#DEBHELPER#
diff -u check-mk-1.1.12/debian/check-mk-config-icinga.preinst check-mk-1.1.12/debian/check-mk-config-icinga.preinst
--- check-mk-1.1.12/debian/check-mk-config-icinga.preinst
+++ check-mk-1.1.12/debian/check-mk-config-icinga.preinst
@@ -5,8 +5,7 @@
dpkg-maintscript-helper mv_conffile \
/etc/icinga/objects/check_mk_templates.cfg \
/etc/icinga/objects/check_mk/check_mk_templates.cfg \
- 1.1.10-2 \
- check-mk-config-icinga. -- "$@"
+ 1.1.10-2 -- "$@"
#DEBHELPER#
reverted:
--- check-mk-1.1.12/debian/check-mk-config-nagios3.prerm
+++ check-mk-1.1.12.orig/debian/check-mk-config-nagios3.prerm
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-set -e
-
-dpkg-maintscript-helper mv_conffile \
- /etc/nagios3/conf.d/check_mk_templates.cfg \
- /etc/nagios3/conf.d/check_mk/check_mk_templates.cfg \
- 1.1.10-2 \
- check-mk-config-nagios3. -- "$@"
-
-#DEBHELPER#
only in patch2:
unchanged:
--- check-mk-1.1.12.orig/debian/check-mk-config-nagios3.preinst
+++ check-mk-1.1.12/debian/check-mk-config-nagios3.preinst
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -e
+
+dpkg-maintscript-helper mv_conffile \
+ /etc/nagios3/conf.d/check_mk_templates.cfg \
+ /etc/nagios3/conf.d/check_mk/check_mk_templates.cfg \
+ 1.1.10-2 -- "$@"
+
+#DEBHELPER#
Thanks,
--
Colin Watson [cjwatson at ubuntu.com]
More information about the Pkg-nagios-devel
mailing list