[apcupsd/f20] reduce amount of debug messages (#1053324)

Michal Hlavinka mhlavink at fedoraproject.org
Thu Jan 23 09:45:29 UTC 2014


commit 8b65fc9239b70fdf51bbf55b888efce51b65cc0d
Author: Michal Hlavinka <mhlavink at redhat.com>
Date:   Thu Jan 23 10:45:47 2014 +0100

    reduce amount of debug messages (#1053324)

 apcupsd-3.14.10-nodbg.patch |   26 ++++++++++++++++++++++++++
 apcupsd.spec                |    9 +++++++--
 2 files changed, 33 insertions(+), 2 deletions(-)
---
diff --git a/apcupsd-3.14.10-nodbg.patch b/apcupsd-3.14.10-nodbg.patch
new file mode 100644
index 0000000..d3f9f56
--- /dev/null
+++ b/apcupsd-3.14.10-nodbg.patch
@@ -0,0 +1,26 @@
+diff -up apcupsd-3.14.10/src/drivers/snmplite/asn.cpp.nodbg apcupsd-3.14.10/src/drivers/snmplite/asn.cpp
+--- apcupsd-3.14.10/src/drivers/snmplite/asn.cpp.nodbg	2010-09-07 17:35:13.000000000 +0200
++++ apcupsd-3.14.10/src/drivers/snmplite/asn.cpp	2014-01-21 17:07:27.603049214 +0100
+@@ -26,10 +26,13 @@
+ #include <stdlib.h>
+ #include <stdio.h>
+ 
++extern int debug_level;
++
+ using namespace Asn;
+ 
+ void debug(const char *foo, int indent)
+ {
++   if (!debug_level) return;
+    while (indent--)
+       printf(" ");
+    printf("%s\n", foo);
+@@ -86,7 +89,7 @@ Object *Object::Demarshal(unsigned char
+       obj = new Sequence(type);
+       break;      
+    default:
+-      printf("UNKNOWN ASN type=0x%02x\n", type);
++      if (debug_level) printf("UNKNOWN ASN type=0x%02x\n", type);
+       debug("UNKNOWN", indent);
+       obj = NULL;
+       break;      
diff --git a/apcupsd.spec b/apcupsd.spec
index f6eae06..7f324c5 100644
--- a/apcupsd.spec
+++ b/apcupsd.spec
@@ -1,6 +1,6 @@
 Name:         apcupsd
 Version:      3.14.10
-Release:      13%{?dist}
+Release:      14%{?dist}
 Summary:      APC UPS Power Control Daemon for Linux
 
 Group:        System Environment/Daemons
@@ -21,12 +21,13 @@ Patch3:       apcupsd-3.14.8-systemd.patch
 # fix crash in gui, rhbz#578276
 Patch4:       apcupsd-3.14.9-fixgui.patch
 Patch5: apcupsd-aarch64.patch
+Patch6: apcupsd-3.14.10-nodbg.patch
 
 BuildRoot:    %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires: glibc-devel >= 2.3, gd-devel > 2.0
 BuildRequires: net-snmp-devel, tcp_wrappers-devel
-BuildRequires: gtk2-devel, gnome-vfs2-devel, desktop-file-utils, sysvinit-tools
+BuildRequires: gtk2-devel, gnome-vfs2-devel, desktop-file-utils
 Requires:      /bin/mail
 Requires(post): systemd-units
 Requires(preun): systemd-units
@@ -71,6 +72,7 @@ A GUI interface to the APC UPS monitoring daemon.
 %patch3 -p1 -b .systemd
 %patch4 -p1 -b .fixgui
 %patch5 -p1 -b .aarch64
+%patch6 -p1 -b .nodbg
 
 #we will handle fedora/redhat part ourselfs
 printf 'install:\n\techo skipped\n' >platforms/redhat/Makefile
@@ -188,6 +190,9 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Thu Jan 23 2014 Michal Hlavinka <mhlavink at redhat.com> - 3.14.10-14
+- reduce amount of debug messages (#1053324)
+
 * Wed Aug 14 2013 Michal Hlavinka <mhlavink at redhat.com> - 3.14.10-13
 - fix aarch64 support (#925007)
 


More information about the scm-commits mailing list