Code

Added email-ignore-size-le-0.dpatch and sensors-ignorelist.dpatch.
authorSebastian Harl <sh@tokkee.org>
Sun, 24 Dec 2006 14:38:03 +0000 (14:38 +0000)
committerSebastian Harl <sh@tokkee.org>
Sun, 24 Dec 2006 14:38:03 +0000 (14:38 +0000)
debian/changelog
debian/control
debian/patches/00list [new file with mode: 0644]
debian/patches/email-ignore-size-le-0.dpatch [new file with mode: 0644]
debian/patches/sensors-ignorelist.dpatch [new file with mode: 0644]
debian/rules

index 6c748fdf95582b71a74e460e364b9c89b51d1a5e..4f050b90c79ca44eecd7b457c3e87f8acfdcea29 100644 (file)
@@ -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 <sh@tokkee.org>  Sat, 23 Dec 2006 10:26:04 +0000
+ -- Sebastian Harl <sh@tokkee.org>  Sun, 24 Dec 2006 14:09:39 +0000
 
 collectd (3.10.4-1) unstable; urgency=low
 
index 13a90d542a8901f99dccd349bd35bbe9dc471d08..9139f77dadb38556dceebce5b40d480a8259b86e 100644 (file)
@@ -2,7 +2,7 @@ Source: collectd
 Section: utils
 Priority: optional
 Maintainer: Sebastian Harl <sh@tokkee.org>
-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 (file)
index 0000000..e83aa55
--- /dev/null
@@ -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 (file)
index 0000000..42430d5
--- /dev/null
@@ -0,0 +1,37 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## email-ignore-size-le-0.dpatch by Sebastian Harl <sh@tokkee.org>
+##
+## 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:<type>:<size>
+ .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:<value> */
+                               pthread_mutex_lock (&score_mutex);
diff --git a/debian/patches/sensors-ignorelist.dpatch b/debian/patches/sensors-ignorelist.dpatch
new file mode 100644 (file)
index 0000000..ea059a1
--- /dev/null
@@ -0,0 +1,48 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## sensors-ignorelist.dpatch by Sebastian Harl <sh@tokkee.org>
+##
+## 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,
index 4169dfa6c67669a08309e5d0a0d5ddea9465b8f1..404da84112b303dfbcf0279ecc0013114579c8e2 100755 (executable)
@@ -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