- Minor PPD.pm fix for PPD import.

This commit is contained in:
Tim Waugh 2004-11-24 09:39:47 +00:00
parent 6a6ddb980a
commit 1195a89b90
2 changed files with 32 additions and 1 deletions

24
foomatic-bad-utf8.patch Normal file
View File

@ -0,0 +1,24 @@
--- foomatic-db-engine-3.0.2/lib/Foomatic/PPD.pm.bad-utf8 2002-10-11 02:16:34.000000000 +0100
+++ foomatic-db-engine-3.0.2/lib/Foomatic/PPD.pm 2004-11-23 19:32:26.000000000 +0000
@@ -300,11 +300,17 @@
sub xml_esc {
my ($in) = (@_);
- $in =~ s!&!&!g;
- $in =~ s!<!&lt;!g;
- $in =~ s!>!&gt;!g;
+ @chars = split(//,$in);
+ $ascii = "";
+ foreach (@chars) {
+ if (ord ($_) > 127) { $_="?"; }
+ $ascii .= $_;
+ }
+ $ascii =~ s!&!&amp;!g;
+ $ascii =~ s!<!&lt;!g;
+ $ascii =~ s!>!&gt;!g;
- return $in;
+ return $ascii;
}
sub pdq_filter {

View File

@ -6,7 +6,7 @@
Summary: Foomatic printer database.
Name: foomatic
Version: 3.0.2
Release: 7
Release: 8
License: GPL
Group: System Environment/Libraries
@ -65,6 +65,9 @@ Patch13: foomatic-ieee1284.patch
# Make foomatic-db-engine build.
Patch14: foomatic-ampathxml.patch
# Handle non-UTF-8 encodings in imported PPD files.
Patch15: foomatic-bad-utf8.patch
Url: http://www.linuxprinting.org
BuildRequires: perl >= 3:5.8.1
BuildRequires: libxml2-devel
@ -120,6 +123,7 @@ chmod a+x mkinstalldirs
%patch6 -p1 -b .ppdload
%patch14 -p1 -b .ampathxml
%patch10 -p1 -b .xml-cflags
%patch15 -p1 -b .bad-utf8
./make_configure
popd
@ -272,6 +276,9 @@ rm -fr %buildroot $RPM_BUILD_DIR/%{name}
%{_mandir}/*/*
%changelog
* Wed Nov 24 2004 Tim Waugh <twaugh@redhat.com> 3.0.2-8
- Minor PPD.pm fix for PPD import.
* Mon Nov 22 2004 Tim Waugh <twaugh@redhat.com> 3.0.2-7
- Applied some foomatic-rip fixes from CVS.