From 0206e1be027b31057e91d65de175c1fdb6e7f9a9 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Sun, 24 Dec 2006 14:38:03 +0000 Subject: [PATCH] Added email-ignore-size-le-0.dpatch and sensors-ignorelist.dpatch. --- debian/changelog | 6 ++- debian/control | 2 +- debian/patches/00list | 3 ++ debian/patches/email-ignore-size-le-0.dpatch | 37 +++++++++++++++ debian/patches/sensors-ignorelist.dpatch | 48 ++++++++++++++++++++ debian/rules | 6 ++- 6 files changed, 98 insertions(+), 4 deletions(-) create mode 100644 debian/patches/00list create mode 100644 debian/patches/email-ignore-size-le-0.dpatch create mode 100644 debian/patches/sensors-ignorelist.dpatch diff --git a/debian/changelog b/debian/changelog index 6c748fd..4f050b9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,8 +12,12 @@ collectd (3.11.0-1) experimental; urgency=low * Do not split off packages introducing new recommendations or suggestions. - Merge collectd-hddtemp into collectd. - Add hddtemp and mbmon to suggested packages. + * Added sensors-ignorelist.dpatch: Avoid assertion in ignorelist_match () + when sensors plugin is not configured. + * Added email-ignore-size-le-0.dpatch: Ignore the size of an email if it is + less than or equal to zero. - -- Sebastian Harl Sat, 23 Dec 2006 10:26:04 +0000 + -- Sebastian Harl Sun, 24 Dec 2006 14:09:39 +0000 collectd (3.10.4-1) unstable; urgency=low diff --git a/debian/control b/debian/control index 13a90d5..9139f77 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: collectd Section: utils Priority: optional Maintainer: Sebastian Harl -Build-Depends: debhelper (>= 5), autotools-dev, libcurl3-gnutls-dev, libmysqlclient15-dev | libmysqlclient14-dev, librrd2-dev | librrd0-dev, libsensors-dev, liboping-dev (>= 0.3.3), libpcap-dev +Build-Depends: debhelper (>= 5), autotools-dev, libcurl3-gnutls-dev, libmysqlclient15-dev | libmysqlclient14-dev, librrd2-dev | librrd0-dev, libsensors-dev, liboping-dev (>= 0.3.3), libpcap-dev, dpatch Build-Conflicts: libpthread-dev Standards-Version: 3.7.2 diff --git a/debian/patches/00list b/debian/patches/00list new file mode 100644 index 0000000..e83aa55 --- /dev/null +++ b/debian/patches/00list @@ -0,0 +1,3 @@ +email-ignore-size-le-0.dpatch +sensors-ignorelist.dpatch + diff --git a/debian/patches/email-ignore-size-le-0.dpatch b/debian/patches/email-ignore-size-le-0.dpatch new file mode 100644 index 0000000..42430d5 --- /dev/null +++ b/debian/patches/email-ignore-size-le-0.dpatch @@ -0,0 +1,37 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## email-ignore-size-le-0.dpatch by Sebastian Harl +## +## DP: email plugin: Ignore size if it less than or equal to zero. + +@DPATCH@ + +diff -uN a/src/collectd.1 b/src/collectd.1 +--- a/src/collectd.1 ++++ b/src/collectd.1 +@@ -271,6 +271,8 @@ + \& e:: + .Ve + .PP ++If \f(CW\*(C`size\*(C'\fR is less than or equal to zero, \f(CW\*(C`size\*(C'\fR is ignored. ++.PP + Spam score: + .PP + .Vb 1 +diff -uN a/src/email.c b/src/email.c +--- a/src/email.c ++++ b/src/email.c +@@ -486,9 +486,11 @@ + type_list_incr (&count, type, 1); + pthread_mutex_unlock (&count_mutex); + +- pthread_mutex_lock (&size_mutex); +- type_list_incr (&size, type, bytes); +- pthread_mutex_unlock (&size_mutex); ++ if (bytes > 0) { ++ pthread_mutex_lock (&size_mutex); ++ type_list_incr (&size, type, bytes); ++ pthread_mutex_unlock (&size_mutex); ++ } + } + else if ('s' == line[0]) { /* s: */ + pthread_mutex_lock (&score_mutex); diff --git a/debian/patches/sensors-ignorelist.dpatch b/debian/patches/sensors-ignorelist.dpatch new file mode 100644 index 0000000..ea059a1 --- /dev/null +++ b/debian/patches/sensors-ignorelist.dpatch @@ -0,0 +1,48 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## sensors-ignorelist.dpatch by Sebastian Harl +## +## DP: sensors plugin: Avoid assertion in ignorelist_match () when not +## DP: configured. + +@DPATCH@ + +diff -uN a/src/sensors.c b/src/sensors.c +--- a/src/sensors.c ++++ b/src/sensors.c +@@ -393,7 +393,8 @@ + sensors_free_features (); + #endif /* if SENSORS_HAVE_READ */ + +- ignorelist_free (sensor_list); ++ if (NULL != sensor_list) ++ ignorelist_free (sensor_list); + } + + static void sensors_voltage_write (char *host, char *inst, char *val) +@@ -402,7 +403,7 @@ + int status; + + /* skip ignored in our config */ +- if (ignorelist_match (sensor_list, inst)) ++ if ((NULL != sensor_list) && ignorelist_match (sensor_list, inst)) + return; + + /* extended sensor naming */ +@@ -423,7 +424,7 @@ + int status; + + /* skip ignored in our config */ +- if (ignorelist_match (sensor_list, inst)) ++ if ((NULL != sensor_list) && ignorelist_match (sensor_list, inst)) + return; + + /* extended sensor naming */ +@@ -450,7 +451,7 @@ + return; + + /* skip ignored in our config */ +- if (ignorelist_match (sensor_list, inst)) ++ if ((NULL != sensor_list) && ignorelist_match (sensor_list, inst)) + return; + + if (snprintf (buf, BUFSIZE, "%u:%.3f", (unsigned int) curtime, diff --git a/debian/rules b/debian/rules index 4169dfa..404da84 100755 --- a/debian/rules +++ b/debian/rules @@ -19,6 +19,8 @@ else CFLAGS += -O2 endif +include /usr/share/dpatch/dpatch.make + config.status: configure dh_testdir CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) \ @@ -28,14 +30,14 @@ config.status: configure build: build-stamp -build-stamp: config.status +build-stamp: config.status patch dh_testdir $(MAKE) touch build-stamp -clean: +clean: unpatch dh_testdir dh_testroot rm -f build-stamp -- 2.30.2