rpms/system-config-printer/F-12 system-config-printer-foomatic-recommended.patch, NONE, 1.1 system-config-printer.spec, 1.331, 1.332
Tim Waugh
twaugh at fedoraproject.org
Wed Dec 23 16:16:22 UTC 2009
Author: twaugh
Update of /cvs/pkgs/rpms/system-config-printer/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv10985
Modified Files:
system-config-printer.spec
Added Files:
system-config-printer-foomatic-recommended.patch
Log Message:
* Wed Dec 23 2009 Tim Waugh <twaugh at redhat.com> - 1.1.16-2
- Prefer foomatic-recommended drivers (bug #550108).
system-config-printer-foomatic-recommended.patch:
ppds.py | 27 +++++++++++++++++++--------
1 file changed, 19 insertions(+), 8 deletions(-)
--- NEW FILE system-config-printer-foomatic-recommended.patch ---
diff -up system-config-printer-1.1.16/cupshelpers/ppds.py.foomatic-recommended system-config-printer-1.1.16/cupshelpers/ppds.py
--- system-config-printer-1.1.16/cupshelpers/ppds.py.foomatic-recommended 2009-12-22 14:27:37.000000000 +0000
+++ system-config-printer-1.1.16/cupshelpers/ppds.py 2009-12-23 16:13:13.234214808 +0000
@@ -248,14 +248,25 @@ def _getDriverType (ppdname, ppds=None):
# Foomatic (generated) -- but which driver?
if ppdname.find ("Generic")!= -1:
return DRIVER_TYPE_FOOMATIC_GENERIC
- if (ppds != None and
- ppds.getInfoFromPPDName (ppdname).\
- get ('ppd-make-and-model', '').find ("(recommended)") != -1):
- if ppds.getInfoFromPPDName (ppdname).\
- get ('ppd-make-and-model', '').find ("Postscript") != -1:
- return DRIVER_TYPE_FOOMATIC_RECOMMENDED_POSTSCRIPT
- else:
- return DRIVER_TYPE_FOOMATIC_RECOMMENDED_NON_POSTSCRIPT
+ if ppds != None:
+ info = ppds.getInfoFromPPDName (ppdname)
+ device_id = info.get ('ppd-device-id', '')
+ id_dict = parseDeviceID (device_id)
+ drv = id_dict.get ('DRV', '')
+ drvfields = dict()
+ for field in drv.split (','):
+ if len (field) == 0:
+ continue
+ key = field[0]
+ drvfields[key] = field[1:]
+
+ ppd_make_and_model = info.get ('ppd-make-and-model', '')
+ if (drvfields.get ('R', '0') == '1' or
+ ppd_make_and_model.find ("(recommended)") != -1):
+ if ppd_make_and_model.find ("Postscript") != -1:
+ return DRIVER_TYPE_FOOMATIC_RECOMMENDED_POSTSCRIPT
+ else:
+ return DRIVER_TYPE_FOOMATIC_RECOMMENDED_NON_POSTSCRIPT
if ppdname.find ("-Postscript")!= -1:
return DRIVER_TYPE_FOOMATIC_PS
if ppdname.find ("-hpijs") != -1:
Index: system-config-printer.spec
===================================================================
RCS file: /cvs/pkgs/rpms/system-config-printer/F-12/system-config-printer.spec,v
retrieving revision 1.331
retrieving revision 1.332
diff -u -p -r1.331 -r1.332
--- system-config-printer.spec 23 Dec 2009 15:03:20 -0000 1.331
+++ system-config-printer.spec 23 Dec 2009 16:16:22 -0000 1.332
@@ -18,6 +18,7 @@ Source2: http://cyberelk.net/tim/data/py
Patch1: system-config-printer-no-epydoc.patch
Patch2: system-config-printer-typo.patch
Patch3: system-config-printer-driver-pre-selection.patch
+Patch4: system-config-printer-foomatic-recommended.patch
BuildRequires: cups-devel >= 1.2
BuildRequires: python-devel >= 2.4
@@ -80,6 +81,7 @@ printers.
%patch1 -p1 -b .no-epydoc
%patch2 -p1 -b .typo
%patch3 -p1 -b .driver-pre-selection
+%patch4 -p1 -b .foomatic-recommended
%build
%configure --with-udev-rules --with-polkit-1
@@ -197,6 +199,7 @@ exit 0
%changelog
* Wed Dec 23 2009 Tim Waugh <twaugh at redhat.com> - 1.1.16-2
+- Prefer foomatic-recommended drivers (bug #550108).
- Pre-select correct driver when adding or changing a queue (bug #550075).
- Fixed typo (bug #550096).
More information about the scm-commits
mailing list