rpms/system-config-printer/devel system-config-printer-install-foomatic-db-ppds.patch, NONE, 1.1 system-config-printer.spec, 1.307, 1.308

Tim Waugh twaugh at fedoraproject.org
Wed Nov 11 15:03:52 UTC 2009


Author: twaugh

Update of /cvs/pkgs/rpms/system-config-printer/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv13919

Modified Files:
	system-config-printer.spec 
Added Files:
	system-config-printer-install-foomatic-db-ppds.patch 
Log Message:
* Wed Nov 11 2009 Tim Waugh <twaugh at redhat.com> 1.1.13-10
- Suggest installing foomatic-db-ppds when appropriate (bug #536831).


system-config-printer-install-foomatic-db-ppds.patch:
 cupshelpers/cupshelpers.py |    5 ++++-
 system-config-printer.py   |   31 +++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 1 deletion(-)

--- NEW FILE system-config-printer-install-foomatic-db-ppds.patch ---
diff -up system-config-printer-1.1.13/cupshelpers/cupshelpers.py.install-foomatic-db-ppds system-config-printer-1.1.13/cupshelpers/cupshelpers.py
--- system-config-printer-1.1.13/cupshelpers/cupshelpers.py.install-foomatic-db-ppds	2009-09-04 10:34:16.000000000 +0100
+++ system-config-printer-1.1.13/cupshelpers/cupshelpers.py	2009-11-11 14:50:51.557767784 +0000
@@ -473,7 +473,10 @@ def parseDeviceID (id):
         id_dict.setdefault("CMD", id_dict["COMMAND SET"])
     for name in ["MFG", "MDL", "CMD", "CLS", "DES", "SN", "S", "P", "J"]:
         id_dict.setdefault(name, "")
-    id_dict["CMD"] = id_dict["CMD"].split(',') 
+    if id_dict["CMD"] == '':
+        id_dict["CMD"] = []
+    else:
+        id_dict["CMD"] = id_dict["CMD"].split(',') 
     return id_dict
 
 class Device:
diff -up system-config-printer-1.1.13/system-config-printer.py.install-foomatic-db-ppds system-config-printer-1.1.13/system-config-printer.py
--- system-config-printer-1.1.13/system-config-printer.py.install-foomatic-db-ppds	2009-11-11 14:50:33.835893883 +0000
+++ system-config-printer-1.1.13/system-config-printer.py	2009-11-11 14:50:51.560768061 +0000
@@ -4293,6 +4293,37 @@ class NewPrinterGUI(GtkGUI):
                     except:
                         nonfatalException ()
 
+                # Decide whether this might be a PostScript capable
+                # printer.  If it might be, check whether
+                # foomatic-db-ppds is installed and suggest installing
+                # it.
+                cmdsets = self.device.id_dict["CMD"]
+                if len (cmdsets) == 0:
+                    # No list of command sets available so might be PS capable
+                    may_be_ps = True
+                else:
+                    # We have the definitive list of command sets supported.
+                    # Only PS capable if it says so.
+                    may_be_ps = False
+                    for cmdset in cmdsets:
+                        if cmdset.lower ().startswith ("postscript"):
+                            may_be_ps = True
+
+                if may_be_ps:
+                    debugprint ("Printer might support PostScript")
+                    try:
+                        os.stat ("/usr/share/cups/model/foomatic-db-ppds")
+                        debugprint ("foomatic-db-ppds already installed")
+                    except OSError:
+                        debugprint ("foomatic-db-ppds not yet installed")
+                        pk = installpackage.PackageKit ()
+                        pid = None
+                        try:
+                            xid = self.mainapp.PrintersWindow.window.xid
+                            pk.InstallPackageName (xid, 0, "foomatic-db-ppds")
+                        except:
+                            pass
+
                 if (not self.remotecupsqueue and
                     not self.new_printer_PPDs_loaded):
                     try:


Index: system-config-printer.spec
===================================================================
RCS file: /cvs/pkgs/rpms/system-config-printer/devel/system-config-printer.spec,v
retrieving revision 1.307
retrieving revision 1.308
diff -u -p -r1.307 -r1.308
--- system-config-printer.spec	5 Nov 2009 11:02:02 -0000	1.307
+++ system-config-printer.spec	11 Nov 2009 15:03:51 -0000	1.308
@@ -7,7 +7,7 @@
 Summary: A printer administration tool
 Name: system-config-printer
 Version: 1.1.13
-Release: 9%{?dist}
+Release: 10%{?dist}
 License: GPLv2+
 URL: http://cyberelk.net/tim/software/system-config-printer/
 Group: System Environment/Base
@@ -35,6 +35,7 @@ Patch17: system-config-printer-no-epydoc
 Patch18: system-config-printer-notification-traceback.patch
 Patch19: system-config-printer-de.po-typo.patch
 Patch20: system-config-printer-test-page-traceback.patch
+Patch21: system-config-printer-install-foomatic-db-ppds.patch
 
 BuildRequires: cups-devel >= 1.2
 BuildRequires: python-devel >= 2.4
@@ -114,6 +115,7 @@ printers.
 %patch18 -p1 -b .notification-traceback
 %patch19 -p1 -b .de.po-typo
 %patch20 -p1 -b .test-page-traceback
+%patch21 -p1 -b .install-foomatic-db-ppds
 
 %build
 %configure --with-udev-rules --with-polkit-1
@@ -225,6 +227,9 @@ rm -rf %buildroot
 exit 0
 
 %changelog
+* Wed Nov 11 2009 Tim Waugh <twaugh at redhat.com> 1.1.13-10
+- Suggest installing foomatic-db-ppds when appropriate (bug #536831).
+
 * Thu Nov  5 2009 Tim Waugh <twaugh at redhat.com> 1.1.13-9
 - Release bump.
 




More information about the fedora-extras-commits mailing list