Treat logging before importing of logger module (bug ).

This commit is contained in:
Jiri Popelka 2014-05-22 11:46:59 +02:00
parent 7f9d7f8363
commit 8360526d20
2 changed files with 45 additions and 1 deletions

37
hplip-log-stderr.patch Normal file
View File

@ -0,0 +1,37 @@
diff -up hplip-3.14.4/fax/backend/hpfax.py.log hplip-3.14.4/fax/backend/hpfax.py
--- hplip-3.14.4/fax/backend/hpfax.py.log 2014-04-04 12:42:15.000000000 +0200
+++ hplip-3.14.4/fax/backend/hpfax.py 2014-05-22 11:39:06.917683733 +0200
@@ -52,7 +52,10 @@ home_dir = ''
def bug(msg):
syslog.syslog("hpfax[%d]: error: %s\n" % (pid, msg))
- log.stderr("ERROR: %s\n" % msg)
+ try:
+ log.stderr("ERROR: %s" % msg)
+ except NameError:
+ sys.stderr.write("ERROR: %s\n" % msg)
if os.path.exists(config_file):
diff -up hplip-3.14.4/prnt/filters/hpps.log hplip-3.14.4/prnt/filters/hpps
--- hplip-3.14.4/prnt/filters/hpps.log 2014-04-04 12:39:47.000000000 +0200
+++ hplip-3.14.4/prnt/filters/hpps 2014-05-22 11:38:30.620187178 +0200
@@ -49,10 +49,16 @@ home_dir = ''
def bug(m):
- log.stderr("ERROR: %s" % m)
+ try:
+ log.stderr("ERROR: %s" % m)
+ except NameError:
+ sys.stderr.write("ERROR: %s\n" % m)
def msg(m):
- log.stderr("INFO: %s" % m)
+ try:
+ log.stderr("INFO: %s" % msg)
+ except NameError:
+ sys.stderr.write("INFO: %s\n" % msg)
if os.path.exists(config_file):
config = ConfigParser.ConfigParser()

View File

@ -7,7 +7,7 @@
Summary: HP Linux Imaging and Printing Project
Name: hplip
Version: 3.14.4
Release: 4%{?dist}
Release: 5%{?dist}
License: GPLv2+ and MIT
Url: http://hplip.sourceforge.net/
@ -31,6 +31,7 @@ Patch14: hplip-deviceIDs-ppd.patch
Patch15: hplip-ppd-ImageableArea.patch
Patch16: hplip-scan-tmp.patch
Patch17: hplip-codec.patch
Patch18: hplip-log-stderr.patch
%global hpijs_epoch 1
Requires: hpijs%{?_isa} = %{hpijs_epoch}:%{version}-%{release}
@ -238,6 +239,9 @@ done
# Fixed codec issue (bug #984167).
%patch17 -p1 -b .codec
# Treat logging before importing of logger module (bug #984699).
%patch18 -p1 -b .log-stderr
sed -i.duplex-constraints \
-e 's,\(UIConstraints.* \*Duplex\),//\1,' \
prnt/drv/hpcups.drv.in
@ -474,6 +478,9 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop
%postun libs -p /sbin/ldconfig
%changelog
* Thu May 22 2014 Jiri Popelka <jpopelka@redhat.com> - 3.14.4-5
- Treat logging before importing of logger module (bug #984699).
* Tue Apr 29 2014 Tim Waugh <twaugh@redhat.com> - 3.14.4-4
- Fixed scan-tmp patch (bug #1076954).