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

Michal Hlavinka mhlavink at fedoraproject.org
Thu Jan 23 10:17:14 UTC 2014


commit 8bd6b3587d8881951dfa0186af1473f44d357ec2
Author: Michal Hlavinka <mhlavink at redhat.com>
Date:   Thu Jan 23 11:17:30 2014 +0100

    reduce amount of debug messages (#1053324)

 apcupsd-3.14.10-nodbg.patch |   26 ++++++++++++++++++++++++++
 apcupsd.spec                |   13 +++++++++----
 2 files changed, 35 insertions(+), 4 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 9eab0ad..9b35da6 100644
--- a/apcupsd.spec
+++ b/apcupsd.spec
@@ -1,6 +1,6 @@
 Name:         apcupsd
 Version:      3.14.10
-Release:      10%{?dist}
+Release:      11%{?dist}
 Summary:      APC UPS Power Control Daemon for Linux
 
 Group:        System Environment/Daemons
@@ -20,12 +20,13 @@ Patch3:       apcupsd-3.14.8-systemd.patch
 
 # fix crash in gui, rhbz#578276
 Patch4:       apcupsd-3.14.9-fixgui.patch
+Patch5: 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
@@ -69,6 +70,7 @@ A GUI interface to the APC UPS monitoring daemon.
 %patch2 -p1 -b .cxxld
 %patch3 -p1 -b .systemd
 %patch4 -p1 -b .fixgui
+%patch5 -p1 -b .nodbg
 
 #we will handle fedora/redhat part ourselfs
 printf 'install:\n\techo skipped\n' >platforms/redhat/Makefile
@@ -186,6 +188,9 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Thu Jan 23 2014 Michal Hlavinka <mhlavink at redhat.com> - 3.14.10-11
+- reduce amount of debug messages (#1053324)
+
 * Fri May 17 2013 Michal Hlavinka <mhlavink at redhat.com> - 3.14.10-10
 - make executables hardened (#955341)
 
@@ -266,7 +271,7 @@ rm -rf $RPM_BUILD_ROOT
 * Mon May 18 2009 Michal Hlavinka <mhlavink at redhat.com> - 3.14.6-1
 - update to 3.14.6
 
-* Thu Feb 24 2009 Michal Hlavinka <mhlavink at redhat.com> - 3.14.5-3
+* Tue Feb 24 2009 Michal Hlavinka <mhlavink at redhat.com> - 3.14.5-3
 - fix build with gcc 4.4
 
 * Mon Feb 23 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.14.5-2
@@ -302,7 +307,7 @@ rm -rf $RPM_BUILD_ROOT
 - Add patch to close open file descriptors (bug #247162)
 - Stop/restart service as needed on removal/upgrade
 
-* Mon Jun 02 2007 - Orion Poplawski <orion at cora.nwra.com> - 3.14.1-2
+* Mon Jun 04 2007 - Orion Poplawski <orion at cora.nwra.com> - 3.14.1-2
 - Add patch for linux USB UPS detection (bug #245864)
 
 * Tue May 29 2007 - Orion Poplawski <orion at cora.nwra.com> - 3.14.1-1


More information about the scm-commits mailing list