- check-device-ids: use make-and-model field for best-matching.

- Use upstream fix for async bugs.
This commit is contained in:
Tim Waugh 2010-03-27 10:26:27 +00:00
parent 56e45a722e
commit 239b28f1fd
3 changed files with 79 additions and 3 deletions

View File

@ -1,6 +1,6 @@
diff -up system-config-printer-1.2.0/asyncipp.py.asyncipp-traceback system-config-printer-1.2.0/asyncipp.py
--- system-config-printer-1.2.0/asyncipp.py.asyncipp-traceback 2010-03-26 12:50:39.829627667 +0000
+++ system-config-printer-1.2.0/asyncipp.py 2010-03-26 12:50:51.888627367 +0000
--- system-config-printer-1.2.0/asyncipp.py.asyncipp-traceback 2010-03-27 10:12:14.667366971 +0000
+++ system-config-printer-1.2.0/asyncipp.py 2010-03-27 10:13:04.081365616 +0000
@@ -59,6 +59,7 @@ class _IPPConnectionThread(threading.Thr
self._auth_handler = auth_handler
self._auth_queue = Queue.Queue (1)
@ -49,3 +49,59 @@ diff -up system-config-printer-1.2.0/asyncipp.py.asyncipp-traceback system-confi
###
### This is the user-visible class. Although it does not inherit from
diff -up system-config-printer-1.2.0/asyncpk1.py.asyncipp-traceback system-config-printer-1.2.0/asyncpk1.py
--- system-config-printer-1.2.0/asyncpk1.py.asyncipp-traceback 2010-03-27 10:12:14.702364469 +0000
+++ system-config-printer-1.2.0/asyncpk1.py 2010-03-27 10:13:06.407243790 +0000
@@ -64,6 +64,7 @@ class _PK1AsyncMethodCall:
self._fallback_fn = fallback_fn
self._fallback_args = args
self._fallback_kwds = kwds
+ self._destroyed = False
debugprint ("+_PK1AsyncMethodCall: %s" % self)
def __del__ (self):
@@ -85,6 +86,7 @@ class _PK1AsyncMethodCall:
def _destroy (self):
debugprint ("DESTROY: %s" % self)
+ self._destroyed = True
del self._bus
del self._conn
del self._pk_method_name
@@ -97,6 +99,9 @@ class _PK1AsyncMethodCall:
del self._fallback_kwds
def _pk_reply_handler (self, error, *args):
+ if self._destroyed:
+ return
+
if str (error) == '':
self._client_reply_handler (self._conn, self._unpack_fn (*args))
self._destroy ()
@@ -106,6 +111,9 @@ class _PK1AsyncMethodCall:
self.call_fallback_fn ()
def _pk_error_handler (self, exc):
+ if self._destroyed:
+ return
+
if exc.get_dbus_name () == CUPS_PK_NEED_AUTH:
exc = cups.IPPError (cups.IPP_NOT_AUTHORIZED, 'pkcancel')
self._client_error_handler (self._conn, exc)
@@ -123,10 +131,16 @@ class _PK1AsyncMethodCall:
self._fallback_fn (*self._fallback_args, **self._fallback_kwds)
def _ipp_reply_handler (self, conn, *args):
+ if self._destroyed:
+ return
+
self._client_reply_handler (self._conn, *args)
self._destroy ()
def _ipp_error_handler (self, conn, *args):
+ if self._destroyed:
+ return
+
self._client_error_handler (self._conn, *args)
self._destroy ()

View File

@ -0,0 +1,12 @@
diff -up system-config-printer-1.2.0/check-device-ids.py.cdi-make-and-model system-config-printer-1.2.0/check-device-ids.py
--- system-config-printer-1.2.0/check-device-ids.py.cdi-make-and-model 2010-03-27 10:16:04.371239756 +0000
+++ system-config-printer-1.2.0/check-device-ids.py 2010-03-27 10:16:14.458240137 +0000
@@ -210,7 +210,7 @@ for device, attrs in devices.iteritems (
mdls = ppds.makes[make]
break
if mdls:
- (s, bestmatches) = ppds._findBestMatchPPDs (mdls, id_fields['MDL'])
+ (s, bestmatches) = ppds._findBestMatchPPDs (mdls, mdl)
if s == ppds.STATUS_SUCCESS:
matches = matches.union (set (bestmatches))

View File

@ -7,7 +7,7 @@
Summary: A printer administration tool
Name: system-config-printer
Version: 1.2.0
Release: 11%{?dist}
Release: 12%{?dist}
License: GPLv2+
URL: http://cyberelk.net/tim/software/system-config-printer/
Group: System Environment/Base
@ -31,6 +31,7 @@ Patch11: system-config-printer-cdi-search-harder.patch
Patch12: system-config-printer-asyncipp-traceback.patch
Patch13: system-config-printer-cdi-lsb-paths.patch
Patch14: system-config-printer-transience.patch
Patch15: system-config-printer-cdi-make-and-model.patch
Patch100: system-config-printer-pycups-build.patch
@ -136,6 +137,9 @@ printers.
# Fixed window transience for 'Change Device URI'.
%patch14 -p1 -b .transience
# check-device-ids: use make-and-model field for best-matching.
%patch15 -p1 -b .cdi-make-and-model
pushd pycups-%{pycups_version}
# Fixed pycups build with new distutils.
@ -258,6 +262,10 @@ rm -rf %buildroot
exit 0
%changelog
* Sat Mar 27 2010 Tim Waugh <twaugh@redhat.com> - 1.2.0-12
- check-device-ids: use make-and-model field for best-matching.
- Use upstream fix for async bugs.
* Fri Mar 26 2010 Tim Waugh <twaugh@redhat.com> - 1.2.0-11
- More async traceback fixes (Ubuntu #547075).