From 7a2c77d87a087de5a3823df8da97b6b748e707e7 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Tue, 2 Sep 2008 13:37:05 +0000 Subject: [PATCH] - Avoid busy-looping when trying to shorten long PPD nicknames. --- foomatic-busyloop.patch | 15 +++++++++++++++ foomatic.spec | 5 +++++ 2 files changed, 20 insertions(+) create mode 100644 foomatic-busyloop.patch diff --git a/foomatic-busyloop.patch b/foomatic-busyloop.patch new file mode 100644 index 0000000..6026186 --- /dev/null +++ b/foomatic-busyloop.patch @@ -0,0 +1,15 @@ +diff -up foomatic-db-engine-3.0-20080710/lib/Foomatic/DB.pm.busyloop foomatic-db-engine-3.0-20080710/lib/Foomatic/DB.pm +--- foomatic-db-engine-3.0-20080710/lib/Foomatic/DB.pm.busyloop 2008-07-10 08:20:10.000000000 +0100 ++++ foomatic-db-engine-3.0-20080710/lib/Foomatic/DB.pm 2008-09-02 14:34:27.000000000 +0100 +@@ -4237,8 +4237,10 @@ EOFPGSZ + # ShortNickName too long? Remove last words from model name. + $parts{'model'} =~ + s/(?<=[a-zA-Z0-9])[^a-zA-Z0-9]+[a-zA-Z0-9]*$//; +- $shortnickname = ++ my $new = + "$parts{'make'} $parts{'model'}, $parts{'driver'}"; ++ last if ($new == $shortnickname); ++ $shortnickname = $new; + } + if (length($shortnickname) > 31) { + # If nothing else helps ... diff --git a/foomatic.spec b/foomatic.spec index 5377860..7193546 100644 --- a/foomatic.spec +++ b/foomatic.spec @@ -42,6 +42,7 @@ Patch15: foomatic-bad-utf8.patch Patch18: foomatic-sigpipe.patch Patch19: foomatic-459847.patch +Patch20: foomatic-busyloop.patch Url: http://www.linuxprinting.org BuildRequires: perl >= 3:5.8.1 @@ -97,6 +98,7 @@ chmod a+x mkinstalldirs %patch14 -p1 -b .ampathxml %patch10 -p1 -b .xml-cflags %patch15 -p1 +%patch20 -p1 -b .busyloop ./make_configure popd @@ -248,6 +250,9 @@ rm -fr %buildroot $RPM_BUILD_DIR/%{name} %{_var}/cache/foomatic %changelog +* Tue Sep 2 2008 Tim Waugh 3.0.2-63 +- Avoid busy-looping when trying to shorten long PPD nicknames. + * Tue Sep 2 2008 Tim Waugh 3.0.2-62 - Removed patch fuzz. - Fixed PPD generation for HP LaserJet 4345 MFP (bug #459847).