[system-config-printer/f15] Make PackageKit optional (bug #726996).

Tim Waugh twaugh at fedoraproject.org
Mon Aug 1 10:42:02 UTC 2011


commit fc34c147b46a3680150c4515d9bf8b5f6c0ab909
Author: Tim Waugh <twaugh at redhat.com>
Date:   Mon Aug 1 10:48:06 2011 +0100

    Make PackageKit optional (bug #726996).

 system-config-printer-packagekit-optional.patch |   26 +++++++++++++++++++++++
 system-config-printer.spec                      |    9 +++++++-
 2 files changed, 34 insertions(+), 1 deletions(-)
---
diff --git a/system-config-printer-packagekit-optional.patch b/system-config-printer-packagekit-optional.patch
new file mode 100644
index 0000000..100e8c3
--- /dev/null
+++ b/system-config-printer-packagekit-optional.patch
@@ -0,0 +1,26 @@
+diff -up system-config-printer-1.3.5/cupshelpers/cupshelpers.py.packagekit-optional system-config-printer-1.3.5/cupshelpers/cupshelpers.py
+--- system-config-printer-1.3.5/cupshelpers/cupshelpers.py.packagekit-optional	2011-07-28 17:04:13.000000000 +0100
++++ system-config-printer-1.3.5/cupshelpers/cupshelpers.py	2011-08-01 10:47:11.614519332 +0100
+@@ -21,8 +21,12 @@
+ 
+ import cups, pprint, os, tempfile, re, string
+ import locale
+-import packagekit.client, packagekit.enums
+ from . import _debugprint
++try:
++    import packagekit.client, packagekit.enums
++    HAVE_PACKAGEKIT=True
++except ImportError:
++    HAVE_PACKAGEKIT=False
+ 
+ class Printer:
+     _flags_blacklist = ["options", "local"]
+@@ -830,7 +834,7 @@ def missingPackagesAndExecutables(ppd):
+     """
+     executables = missingExecutables(ppd)
+     packages = []
+-    if executables:
++    if executables and HAVE_PACKAGEKIT:
+         unresolved_executables = []
+         client = packagekit.client.PackageKitClient ()
+         for executable in executables:
diff --git a/system-config-printer.spec b/system-config-printer.spec
index be71162..e5f31e4 100644
--- a/system-config-printer.spec
+++ b/system-config-printer.spec
@@ -5,13 +5,14 @@
 Summary: A printer administration tool
 Name: system-config-printer
 Version: 1.3.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.3/%{name}-%{version}.tar.xz
 Patch1: system-config-printer-no-applet-in-gnome.patch
 Patch2: system-config-printer-bug726682.patch
+Patch3: system-config-printer-packagekit-optional.patch
 BuildRequires: cups-devel >= 1.2
 BuildRequires: desktop-file-utils >= 0.2.92
 BuildRequires: gettext-devel
@@ -79,6 +80,9 @@ printers.
 # Import dbus in serversettings module (bug #726682).
 %patch2 -p1 -b .bug726682
 
+# Make PackageKit optional (bug #726996).
+%patch3 -p1 -b .bug726682
+
 %build
 %configure --with-udev-rules
 
@@ -205,6 +209,9 @@ if [ $1 -ge 1 ] ; then
 fi
 
 %changelog
+* Mon Aug  1 2011 Tim Waugh <twaugh at redhat.com> 1.3.5-2
+- Make PackageKit optional (bug #726996).
+
 * Fri Jul 29 2011 Tim Waugh <twaugh at redhat.com> 1.3.5-1
 - 1.3.5:
   - Driver selection, missing executables checking, and physical


More information about the scm-commits mailing list