From: Sebastian Harl Date: Thu, 3 May 2007 16:39:22 +0000 (+0200) Subject: Check for XML::Simple in collectd.postinst. X-Git-Tag: collectd-4.0.2-1~43 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=691b661bbdf2683570d2f131f3ef71faa6d31087;p=pkg-collectd.git Check for XML::Simple in collectd.postinst. If the script fails to detect XML::Simple it will disable auto-migration. --- diff --git a/debian/collectd.config b/debian/collectd.config index 0a57dc8..2bbbf8e 100755 --- a/debian/collectd.config +++ b/debian/collectd.config @@ -17,8 +17,13 @@ case "$1" in db_set collectd/auto-migrate-3-4 false if dpkg --compare-versions "$2" lt-nl "4.0.0~"; then - db_input high collectd/auto-migrate-3-4 || true - db_go || true + if perl -MXML::Simple -e '1' 2> /dev/null; then + db_input high collectd/auto-migrate-3-4 || true + db_go || true + else + db_input high collectd/migration-3-4 || true + db_go || true + fi fi ;; diff --git a/debian/collectd.templates b/debian/collectd.templates index 21de8e5..b1f2f76 100644 --- a/debian/collectd.templates +++ b/debian/collectd.templates @@ -1,15 +1,26 @@ +Template: collectd/migration-3-4 +Type: note +_Description: Layout of RRD files has changed + The layout of the RRD files created by collectd has changed significantly + since version 3.x. In order to keep your old data you have to migrate it. + This can be done by using /usr/lib/collectd/utils/migrate-3-4.px. + . + This step requires the XML::Simple Perl module (libxml-simple-perl) which you + do not currently have installed. You need to perform the migration manually. + . + See /usr/share/doc/collectd/NEWS.Debian for details. + Template: collectd/auto-migrate-3-4 Type: boolean Default: false _Description: Automatically try to migrate your RRD files? The layout of the RRD files created by collectd has changed significantly since version 3.x. In order to keep your old data you have to migrate it. - This can be done by using /usr/lib/collectd/utils/migrate-3-4.px. This step - can be done automatically. In this case a backup of /var/lib/collectd/ is - made in /var/backups/. You need to have the XML::Simple Perl module - (libxml-simple-per) installed for this script to work. + This can be done by using /usr/lib/collectd/utils/migrate-3-4.px. . - See /usr/share/doc/collectd/NEWS.Debian for details. + This step can be done automatically. In this case a backup of + /var/lib/collectd/ is made in /var/backups/. This script is still + experimental, though. Do not expect it to work in all cases. . - This script is still experimental. Do not expect it to work in all cases. + See /usr/share/doc/collectd/NEWS.Debian for details. diff --git a/debian/control b/debian/control index 3f7773e..88c4b4d 100644 --- a/debian/control +++ b/debian/control @@ -9,6 +9,7 @@ Standards-Version: 3.7.2 Package: collectd Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: libxml-simple-perl Suggests: collectd-apache, collectd-mysql, collectd-sensors, collectd-dev, collectd-ping, collectd-dns, collectd-perl,librrds-perl, hddtemp, mbmon Provides: collectd-hddtemp diff --git a/debian/po/templates.pot b/debian/po/templates.pot index fbf3c2c..a389214 100644 --- a/debian/po/templates.pot +++ b/debian/po/templates.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: sh@tokkee.org\n" -"POT-Creation-Date: 2007-05-01 22:08+0200\n" +"POT-Creation-Date: 2007-05-03 18:36+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -16,33 +16,51 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#. Type: boolean +#. Type: note #. Description #: ../collectd.templates:1001 -msgid "Automatically try to migrate your RRD files?" +msgid "Layout of RRD files has changed" msgstr "" +#. Type: note +#. Description #. Type: boolean #. Description -#: ../collectd.templates:1001 +#: ../collectd.templates:1001 ../collectd.templates:2001 msgid "" "The layout of the RRD files created by collectd has changed significantly " "since version 3.x. In order to keep your old data you have to migrate it. " -"This can be done by using /usr/lib/collectd/utils/migrate-3-4.px. This step " -"can be done automatically. In this case a backup of /var/lib/collectd/ is " -"made in /var/backups/. You need to have the XML::Simple Perl module (libxml-" -"simple-per) installed for this script to work." +"This can be done by using /usr/lib/collectd/utils/migrate-3-4.px." msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../collectd.templates:1001 +msgid "" +"This step requires the XML::Simple Perl module (libxml-simple-perl) which " +"you do not currently have installed. You need to perform the migration " +"manually." +msgstr "" + +#. Type: note +#. Description +#. Type: boolean +#. Description +#: ../collectd.templates:1001 ../collectd.templates:2001 msgid "See /usr/share/doc/collectd/NEWS.Debian for details." msgstr "" #. Type: boolean #. Description -#: ../collectd.templates:1001 +#: ../collectd.templates:2001 +msgid "Automatically try to migrate your RRD files?" +msgstr "" + +#. Type: boolean +#. Description +#: ../collectd.templates:2001 msgid "" -"This script is still experimental. Do not expect it to work in all cases." +"This step can be done automatically. In this case a backup of /var/lib/" +"collectd/ is made in /var/backups/. This script is still experimental, " +"though. Do not expect it to work in all cases." msgstr ""