[system-config-printer/f20] Handle failure when cups-pk-helper not installed (bug #1118836).

Tim Waugh twaugh at fedoraproject.org
Fri Jul 11 16:40:41 UTC 2014


commit e429fbbe828f8474331f14204e8993f1618d8772
Author: Tim Waugh <twaugh at redhat.com>
Date:   Fri Jul 11 17:26:36 2014 +0100

    Handle failure when cups-pk-helper not installed (bug #1118836).
    
    Resolves: rhbz#1118836

 system-config-printer-permission.patch |   21 +++++++++++++++++++++
 system-config-printer.spec             |    9 ++++++++-
 2 files changed, 29 insertions(+), 1 deletions(-)
---
diff --git a/system-config-printer-permission.patch b/system-config-printer-permission.patch
new file mode 100644
index 0000000..3483700
--- /dev/null
+++ b/system-config-printer-permission.patch
@@ -0,0 +1,21 @@
+diff -up system-config-printer-1.4.5/system-config-printer.py.permission system-config-printer-1.4.5/system-config-printer.py
+--- system-config-printer-1.4.5/system-config-printer.py.permission	2014-07-04 17:02:41.000000000 +0100
++++ system-config-printer-1.4.5/system-config-printer.py	2014-07-11 17:25:28.027096533 +0100
+@@ -207,11 +207,13 @@ class GUI(GtkGUI):
+         Gtk.Window.set_default_icon_name ('printer')
+ 
+         edit_action = 'org.opensuse.cupspkhelper.mechanism.all-edit'
++        self.edit_permission = None
+         if Polkit:
+-            self.edit_permission = Polkit.Permission.new_sync (edit_action,
+-                                                               None, None)
+-        else:
+-            self.edit_permission = None
++            try:
++                self.edit_permission = Polkit.Permission.new_sync (edit_action,
++                                                                   None, None)
++            except GLib.GError:
++                pass # Maybe cups-pk-helper isn't installed.
+ 
+         self.unlock_button = Gtk.LockButton ()
+         if self.edit_permission != None:
diff --git a/system-config-printer.spec b/system-config-printer.spec
index 9cbe592..9b136a2 100644
--- a/system-config-printer.spec
+++ b/system-config-printer.spec
@@ -1,12 +1,13 @@
 Summary: A printer administration tool
 Name: system-config-printer
 Version: 1.4.5
-Release: 1%{?dist}
+Release: 2%{?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.4/%{name}-%{version}.tar.xz
 Patch1: system-config-printer-no-applet-in-gnome.patch
+Patch2: system-config-printer-permission.patch
 
 BuildRequires: cups-devel >= 1.2
 BuildRequires: desktop-file-utils >= 0.2.92
@@ -70,6 +71,9 @@ printers.
 # Don't start the applet in GNOME.
 %patch1 -p1 -b .no-applet-in-gnome
 
+# Handle failure when cups-pk-helper not installed (bug #1118836).
+%patch2 -p1 -b .permission
+
 sed -i.cflags-override -e '/^CFLAGS/d' Makefile.{am,in}
 
 %build
@@ -170,6 +174,9 @@ touch %buildroot%{_localstatedir}/run/udev-configure-printer/usb-uris
 exit 0
 
 %changelog
+* Fri Jul 11 2014 Tim Waugh <twaugh at redhat.com> 1.4.5-2
+- Handle failure when cups-pk-helper not installed (bug #1118836).
+
 * Fri Jul  4 2014 Tim Waugh <twaugh at redhat.com> 1.4.5-1
 - 1.4.5:
   - Some codec fixes (bug #968142, bug #1023968, bug #1094037).


More information about the scm-commits mailing list