From 7e228058b157d580f5bc25719e6ddc10042ced5d Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Tue, 17 Jun 2014 21:29:18 +0200 Subject: [PATCH] Fix parsing of avahi-daemon output (bug #1096939). --- hplip-avahi-parsing.patch | 19 +++++++++++++++++++ hplip.spec | 9 ++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 hplip-avahi-parsing.patch diff --git a/hplip-avahi-parsing.patch b/hplip-avahi-parsing.patch new file mode 100644 index 0000000..6e8ebca --- /dev/null +++ b/hplip-avahi-parsing.patch @@ -0,0 +1,19 @@ +diff -up hplip-3.14.6/base/avahi.py.avahi-parsing hplip-3.14.6/base/avahi.py +--- hplip-3.14.6/base/avahi.py.avahi-parsing 2014-06-17 14:42:57.557586402 +0100 ++++ hplip-3.14.6/base/avahi.py 2014-06-17 14:45:56.104509934 +0100 +@@ -59,9 +59,13 @@ def detectNetworkDevices(ttl=4, timeout= + 'status_code': 0, 'device2': '0', 'device3': '0', 'note': ''} + y['ip'] = ip + y['hn'] = bits[6].replace('.local', '') +- details = bits[9].split('" "') ++ details = bits[9].rstrip ().strip ('"').split('" "') + for item in details: +- key, value = item.split('=', 1) ++ keyvalue = item.split('=', 1) ++ if len (keyvalue) < 2: ++ # Skip parts that don't match key=value ++ continue ++ key, value = keyvalue + if key == 'ty': + y['mdns'] = value + y['device1'] = "MFG:Hewlett-Packard;MDL:%s;CLS:PRINTER;" % value diff --git a/hplip.spec b/hplip.spec index d014520..db1da53 100644 --- a/hplip.spec +++ b/hplip.spec @@ -7,7 +7,7 @@ Summary: HP Linux Imaging and Printing Project Name: hplip Version: 3.14.6 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ and MIT Url: http://hplip.sourceforge.net/ @@ -32,6 +32,7 @@ Patch15: hplip-ppd-ImageableArea.patch Patch16: hplip-scan-tmp.patch Patch17: hplip-codec.patch Patch18: hplip-log-stderr.patch +Patch19: hplip-avahi-parsing.patch %global hpijs_epoch 1 Requires: hpijs%{?_isa} = %{hpijs_epoch}:%{version}-%{release} @@ -242,6 +243,9 @@ done # Treat logging before importing of logger module (bug #984699). %patch18 -p1 -b .log-stderr +# Fix parsing of avahi-daemon output (bug #1096939). +%patch19 -p1 -b .parsing + sed -i.duplex-constraints \ -e 's,\(UIConstraints.* \*Duplex\),//\1,' \ prnt/drv/hpcups.drv.in @@ -478,6 +482,9 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop %postun libs -p /sbin/ldconfig %changelog +* Tue Jun 17 2014 Jiri Popelka - 3.14.6-2 +- Fix parsing of avahi-daemon output (bug #1096939). + * Thu Jun 05 2014 Jiri Popelka - 3.14.6-1 - 3.14.6