diff options
Diffstat (limited to 'debian/patches/0054-Fix-parsing-of-avahi-daemon-output.patch')
-rw-r--r-- | debian/patches/0054-Fix-parsing-of-avahi-daemon-output.patch | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/debian/patches/0054-Fix-parsing-of-avahi-daemon-output.patch b/debian/patches/0054-Fix-parsing-of-avahi-daemon-output.patch new file mode 100644 index 000000000..5432b75ad --- /dev/null +++ b/debian/patches/0054-Fix-parsing-of-avahi-daemon-output.patch @@ -0,0 +1,29 @@ +From: =?utf-8?b?SmnFmcOtIFBvcGVsa2E=?= <jpopelka@fedoraproject.org> +Date: Fri, 31 Jan 2020 12:58:28 +0100 +Subject: Fix parsing of avahi-daemon output + +Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-avahi-parsing.patch +--- + base/avahi.py | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/base/avahi.py b/base/avahi.py +index 38a0e29..e96296b 100755 +--- a/base/avahi.py ++++ b/base/avahi.py +@@ -52,9 +52,14 @@ def detectNetworkDevices(ttl=4, timeout=10): + '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 |