Accepting request 765845 from Printing
- Use /etc/sane.d/dll.d/hpaio to register SANE backend rather than modifying /etc/sane/dll.conf - SANE backend must be configured in hplip-sane package (bsc#1160708) - Revert changes from 3.18.5 that break hp-setup for fax devices (bsc#1107711, lp#1773320) * Added patch: Revert-changes-from-3.18.5-that-break-hp-setup-for-f.patch OBS-URL: https://build.opensuse.org/request/show/765845 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/hplip?expand=0&rev=130
This commit is contained in:
commit
0c703bea40
60
Revert-changes-from-3.18.5-that-break-hp-setup-for-f.patch
Normal file
60
Revert-changes-from-3.18.5-that-break-hp-setup-for-f.patch
Normal file
@ -0,0 +1,60 @@
|
||||
From af8ddd502a88f8dc0910c2c9a91471be8434af61 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Wilck <mwilck@suse.com>
|
||||
Date: Mon, 13 Jan 2020 18:20:22 +0100
|
||||
Subject: [PATCH] Revert changes from 3.18.5 that break hp-setup for fax
|
||||
devices
|
||||
|
||||
See bsc#1107711, lp#1773320
|
||||
https://launchpadlibrarian.net/371794274/hplip-use-binary-str.patch
|
||||
|
||||
Credits: Eric Schirra <ecsos@schirra.net>
|
||||
---
|
||||
base/utils.py | 5 +----
|
||||
fax/pmlfax.py | 8 ++++----
|
||||
2 files changed, 5 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/base/utils.py b/base/utils.py
|
||||
index f268cf8..cc77820 100644
|
||||
--- a/base/utils.py
|
||||
+++ b/base/utils.py
|
||||
@@ -954,10 +954,7 @@ else:
|
||||
|
||||
|
||||
def printable(s):
|
||||
- if s:
|
||||
- return s.translate(identity, unprintable)
|
||||
- else:
|
||||
- return ""
|
||||
+ return s.translate(identity, unprintable)
|
||||
|
||||
|
||||
def any(S,f=lambda x:x):
|
||||
diff --git a/fax/pmlfax.py b/fax/pmlfax.py
|
||||
index adcc1cb..b68ff6a 100644
|
||||
--- a/fax/pmlfax.py
|
||||
+++ b/fax/pmlfax.py
|
||||
@@ -143,8 +143,8 @@ class PMLFaxDevice(FaxDevice):
|
||||
|
||||
def getPhoneNum(self):
|
||||
if PY3:
|
||||
- data = utils.printable(self.getPML(pml.OID_FAX_LOCAL_PHONE_NUM)[1])
|
||||
- return data
|
||||
+ data = utils.printable(self.getPML(pml.OID_FAX_LOCAL_PHONE_NUM)[1].encode('utf-8'))
|
||||
+ return data.decode('utf-8')
|
||||
else:
|
||||
return utils.printable(self.getPML(pml.OID_FAX_LOCAL_PHONE_NUM)[1])
|
||||
phone_num = property(getPhoneNum, setPhoneNum, doc="OID_FAX_LOCAL_PHONE_NUM")
|
||||
@@ -155,8 +155,8 @@ class PMLFaxDevice(FaxDevice):
|
||||
|
||||
def getStationName(self):
|
||||
if PY3:
|
||||
- data = utils.printable(self.getPML(pml.OID_FAX_STATION_NAME)[1])
|
||||
- return data
|
||||
+ data = utils.printable(self.getPML(pml.OID_FAX_STATION_NAME)[1].encode('utf-8'))
|
||||
+ return data.decode('utf-8')
|
||||
else:
|
||||
return utils.printable(self.getPML(pml.OID_FAX_STATION_NAME)[1])
|
||||
|
||||
--
|
||||
2.24.1
|
||||
|
@ -1,3 +1,17 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Jan 13 22:01:08 UTC 2020 - Martin Wilck <mwilck@suse.com>
|
||||
|
||||
- Use /etc/sane.d/dll.d/hpaio to register SANE backend rather
|
||||
than modifying /etc/sane/dll.conf
|
||||
- SANE backend must be configured in hplip-sane package (bsc#1160708)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jan 13 17:27:20 UTC 2020 - Martin Wilck <mwilck@suse.com>
|
||||
|
||||
- Revert changes from 3.18.5 that break hp-setup for fax devices
|
||||
(bsc#1107711, lp#1773320)
|
||||
* Added patch: Revert-changes-from-3.18.5-that-break-hp-setup-for-f.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jan 10 13:52:53 UTC 2020 - Martin Wilck <mwilck@suse.com>
|
||||
|
||||
|
40
hplip.spec
40
hplip.spec
@ -81,6 +81,8 @@ Patch401: hplip-orblite-return-null.diff
|
||||
# Use a pgp server (pool.sks-keyservers.net) which doesn't throw proxy errors
|
||||
# or run into timeouts most of the time
|
||||
Patch402: hplip-change-pgp-server.patch
|
||||
# boo#1107711
|
||||
Patch403: Revert-changes-from-3.18.5-that-break-hp-setup-for-f.patch
|
||||
BuildRequires: %{pymod devel}
|
||||
BuildRequires: %{pymod qt5-devel}
|
||||
BuildRequires: %{pymod xml}
|
||||
@ -314,6 +316,7 @@ This sub-package is only required by developers.
|
||||
%patch400 -p1
|
||||
%patch401 -p1
|
||||
%patch402 -p1
|
||||
%patch403 -p1
|
||||
|
||||
# replace "env" shebang and "/usr/bin/python" with real executable
|
||||
find . -name '*.py' -o -name pstotiff | \
|
||||
@ -447,6 +450,8 @@ install -d %{buildroot}%{_localstatedir}/log/hp/tmp
|
||||
# Remove the installed /etc/sane.d/dll.conf
|
||||
# because this is provided by the sane-backends package:
|
||||
rm %{buildroot}%{_sysconfdir}/sane.d/dll.conf
|
||||
mkdir %{buildroot}%{_sysconfdir}/sane.d/dll.d
|
||||
echo hpaio >%{buildroot}%{_sysconfdir}/sane.d/dll.d/hpaio
|
||||
# Remove the installed HAL fdi file because HAL is no longer used (HAL is deprecated):
|
||||
rm %{buildroot}%{_datadir}/hal/fdi/preprobe/10osvendor/20-hplip-devices.fdi
|
||||
# Remove the installed hplip-printer@.service file for systemd
|
||||
@ -578,38 +583,18 @@ install -m 644 %{SOURCE102} %{buildroot}%{_mandir}/man1/
|
||||
/sbin/ldconfig
|
||||
exit 0
|
||||
|
||||
%triggerin -p /bin/bash -- sane-backends
|
||||
# As hplip can be used for plain printers it cannot "PreReq sane-backends".
|
||||
# Therefore if sane-backends is installed it may be installed or updated after hplip.
|
||||
# In this case trigger to add the SANE backend "hpaio" to /etc/sane.d/dll.conf if it is not there.
|
||||
# To be safe there is a test that /etc/sane.d/dll.conf is writable.
|
||||
if [ -w %{_sysconfdir}/sane.d/dll.conf ]
|
||||
then if ! grep -q 'hpaio' %{_sysconfdir}/sane.d/dll.conf
|
||||
then echo -e '# The hpaio backend is provided by the hplip package:\n#hpaio' >>%{_sysconfdir}/sane.d/dll.conf
|
||||
fi
|
||||
fi
|
||||
exit 0
|
||||
|
||||
%postun -p /bin/bash
|
||||
%desktop_database_postun
|
||||
%icon_theme_cache_postun
|
||||
/sbin/ldconfig
|
||||
|
||||
%postun sane
|
||||
# Earlier versions of hplip modified /etc/sane.d/dll.conf
|
||||
# Now we use /etc/sane.d/dll.d (multiple hpaio entries don't hurt).
|
||||
# If the package was removed (but not if it was updated)
|
||||
# then remove the hpaio lines in /etc/sane.d/dll.conf.
|
||||
# Don't remove them when the hplip package was automatically
|
||||
# replaced by the hplip17 package (via RPM obsoletes) or vice versa.
|
||||
# Because postun of the old package runs last (after triggerin -- sane-backends)
|
||||
# it is done via a special "ls" test if any libsane-hpaio.so exists
|
||||
# (e.g. there could be only 32-bit installed on 64-bit hardware).
|
||||
# If the "ls" test does not fail, some kind of HPLIP is installed.
|
||||
# The package sane-backends may not be installed (see triggerin)
|
||||
# and therefore the test that /etc/sane.d/dll.conf is writable.
|
||||
# The "exit 0" is necessary, otherwise the postun script
|
||||
# would exit with non-zero exit-code if the package was not removed.
|
||||
if [ "$1" = "0" ]
|
||||
then if ! ls %{_prefix}/lib*/sane/libsane-hpaio.so* &>/dev/null
|
||||
then [ -w %{_sysconfdir}/sane.d/dll.conf ] && sed -i -e '/hpaio/d' %{_sysconfdir}/sane.d/dll.conf
|
||||
fi
|
||||
if [ "$1" = "0" ] && [ -w %{_sysconfdir}/sane.d/dll.conf ]; then
|
||||
sed -i -e '/hpaio/d' %{_sysconfdir}/sane.d/dll.conf
|
||||
fi
|
||||
exit 0
|
||||
|
||||
@ -740,6 +725,9 @@ exit 0
|
||||
%files sane
|
||||
%dir %{_libdir}/sane
|
||||
%{_libdir}/sane/libsane-hpaio.so.*
|
||||
%dir %{_sysconfdir}/sane.d
|
||||
%dir %{_sysconfdir}/sane.d/dll.d
|
||||
%{_sysconfdir}/sane.d/dll.d/hpaio
|
||||
|
||||
%files devel
|
||||
%{_libdir}/libhpip.so
|
||||
|
Loading…
Reference in New Issue
Block a user