From e96733cb24cfceb01da6c110b84fa2ef4bf2e754 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Fri, 3 Feb 2012 15:41:53 +0000 Subject: [PATCH] Upstream patch to fix ppdcache traceback (bug #786232). --- system-config-printer-ppdcache-enoent.patch | 31 +++++++++++++++++++++ system-config-printer.spec | 8 +++++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 system-config-printer-ppdcache-enoent.patch diff --git a/system-config-printer-ppdcache-enoent.patch b/system-config-printer-ppdcache-enoent.patch new file mode 100644 index 0000000..e4c5354 --- /dev/null +++ b/system-config-printer-ppdcache-enoent.patch @@ -0,0 +1,31 @@ +diff -up system-config-printer-1.3.8/ppdcache.py.ppdcache-enoent system-config-printer-1.3.8/ppdcache.py +--- system-config-printer-1.3.8/ppdcache.py.ppdcache-enoent 2011-10-26 13:14:20.000000000 +0100 ++++ system-config-printer-1.3.8/ppdcache.py 2012-02-03 15:40:36.215015934 +0000 +@@ -123,14 +123,20 @@ class PPDCache: + # Store an open file object, then remove the actual + # file. This way we don't leave temporary files + # around. +- self._cache[name] = file (filename) +- debugprint ("%s: caching %s (fd %d) " +- "(%s) - %s" % (self, filename, +- self._cache[name].fileno (), +- modtime, status)) +- os.unlink (filename) +- self._modtimes[name] = modtime ++ try: ++ self._cache[name] = file (filename) ++ debugprint ("%s: caching %s (fd %d) " ++ "(%s) - %s" % (self, filename, ++ self._cache[name].fileno (), ++ modtime, status)) ++ os.unlink (filename) ++ self._modtimes[name] = modtime ++ except IOError: ++ # File disappeared? ++ debugprint ("%s: file %s disappeared? Unable to cache it" ++ % (self, filename)) + ++ # Now fetch it from our own cache. + self.fetch_ppd (name, callback, check_uptodate=False) + else: + self._schedule_callback (callback, name, diff --git a/system-config-printer.spec b/system-config-printer.spec index cb48d3e..bf8d3da 100644 --- a/system-config-printer.spec +++ b/system-config-printer.spec @@ -1,13 +1,14 @@ Summary: A printer administration tool Name: system-config-printer Version: 1.3.8 -Release: 2%{?dist} +Release: 3%{?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-1.3.8-debuginfo.patch +Patch3: system-config-printer-ppdcache-enoent.patch BuildRequires: cups-devel >= 1.2 BuildRequires: desktop-file-utils >= 0.2.92 BuildRequires: gettext-devel @@ -65,6 +66,8 @@ printers. %patch1 -p1 -b .no-applet-in-gnome # Fix several debugprints (#785581) %patch2 -p1 -b .debugprint +# Upstream patch to fix ppdcache traceback (bug #786232). +%patch3 -p1 -b .ppdcache-enoent %build %configure --with-udev-rules @@ -185,6 +188,9 @@ if [ $1 -ge 1 ] ; then fi %changelog +* Fri Feb 3 2012 Tim Waugh 1.3.8-3 +- Upstream patch to fix ppdcache traceback (bug #786232). + * Mon Jan 30 2012 Jiri Popelka 1.3.8-2 - Fixed several debugprints (#785581). - Clean up and modernize spec file.