[system-config-printer] Prevent traceback during libsane-hpaio installation check.
Tim Waugh
twaugh at fedoraproject.org
Thu Feb 17 10:11:34 UTC 2011
commit f489c6ff1472ede401974964f86168218b9e1497
Author: Tim Waugh <twaugh at redhat.com>
Date: Thu Feb 17 10:00:53 2011 +0000
Prevent traceback during libsane-hpaio installation check.
system-config-printer-hp-scannable.patch | 30 ++++++++++++++++++++++++++++++
system-config-printer.spec | 7 ++++++-
2 files changed, 36 insertions(+), 1 deletions(-)
---
diff --git a/system-config-printer-hp-scannable.patch b/system-config-printer-hp-scannable.patch
new file mode 100644
index 0000000..3603311
--- /dev/null
+++ b/system-config-printer-hp-scannable.patch
@@ -0,0 +1,30 @@
+diff -up system-config-printer-1.3.0/newprinter.py.hp-scannable system-config-printer-1.3.0/newprinter.py
+--- system-config-printer-1.3.0/newprinter.py.hp-scannable 2011-02-16 13:02:45.000000000 +0000
++++ system-config-printer-1.3.0/newprinter.py 2011-02-17 09:58:51.867125793 +0000
+@@ -971,7 +971,8 @@ class NewPrinterGUI(GtkGUI):
+ ready (self.NewPrinterWindow)
+ return
+
+- if (self.device.hp_scannable and
++ if (hasattr (self.device, 'hp_scannable') and
++ self.device.hp_scannable and
+ not os.access ("/etc/sane.d/dll.d/hpaio", os.R_OK)):
+ try:
+ pk = installpackage.PackageKit ()
+@@ -2467,15 +2468,6 @@ class NewPrinterGUI(GtkGUI):
+ physicaldevice.add_device (faxdev)
+
+ physicaldevice.set_data ('hp-scannable', True)
+- if hp_scannable and not os.access ("/etc/sane.d/dll.d/hpaio",
+- os.R_OK):
+- try:
+- pk = installpackage.PackageKit ()
+- xid = self.NewPrinterWindow.window.xid
+- pk.InstallPackageName (xid, 0, "libsane-hpaio")
+- except:
+- pass
+-
+ physicaldevice.set_data ('checked-hplip', True)
+
+ device.hp_scannable = physicaldevice.get_data ('hp-scannable')
+diff -up system-config-printer-1.3.0/system-config-printer.py.hp-scannable system-config-printer-1.3.0/system-config-printer.py
diff --git a/system-config-printer.spec b/system-config-printer.spec
index ce33b5b..d4c8a74 100644
--- a/system-config-printer.spec
+++ b/system-config-printer.spec
@@ -5,12 +5,13 @@
Summary: A printer administration tool
Name: system-config-printer
Version: 1.3.0
-Release: 2%{?dist}
+Release: 3%{?dist}
License: GPLv2+
URL: http://cyberelk.net/tim/software/system-config-printer/
Group: System Environment/Base
Source0: http://cyberelk.net/tim/data/system-config-printer/1.2/%{name}-%{version}.tar.xz
Patch1: system-config-printer-no-job-notifications.patch
+Patch2: system-config-printer-hp-scannable.patch
BuildRequires: cups-devel >= 1.2
BuildRequires: desktop-file-utils >= 0.2.92
BuildRequires: gettext-devel
@@ -68,6 +69,7 @@ printers.
%prep
%setup -q
%patch1 -p1 -b .no-job-notifications
+%patch2 -p1 -b .hp-scannable
%build
%configure --with-udev-rules
@@ -177,6 +179,9 @@ rm -rf %buildroot
exit 0
%changelog
+* Thu Feb 17 2011 Tim Waugh <twaugh at redhat.com> 1.3.0-3
+- Prevent traceback during libsane-hpaio installation check.
+
* Wed Feb 16 2011 Tim Waugh <twaugh at redhat.com> 1.3.0-2
- Don't show job notifications from the applet, just do New Printer
notifications and handle requests to install printer drivers
More information about the scm-commits
mailing list