From: Ian Jackson Date: Wed, 25 Jan 2012 21:51:03 +0000 (+0000) Subject: tolerate pcf2bdf crashing X-Git-Tag: debian/1.3~4 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=xfonts-traditional.git;a=commitdiff_plain;h=1987c934200d2f253320fc7b2c1c05827c9bc9cd tolerate pcf2bdf crashing --- diff --git a/debian/changelog b/debian/changelog index 44d2913..98aebcc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ xfonts-traditional (1.3) unstable; urgency=low + * Tolerate fonts which make pcf2bdf crash (by default). * Process multiple fonts in parallel. * General improvements to handling of errors and unprocessed fonts. diff --git a/update-xfonts-traditional b/update-xfonts-traditional index 2e8c0d7..63e9040 100755 --- a/update-xfonts-traditional +++ b/update-xfonts-traditional @@ -23,6 +23,7 @@ our $verbose=0; our $reportfh; our $foundryinfo; our %props; +our $tolerate_bad_fonts=1; our $wanted_parallel; sub reportloaded { @@ -259,6 +260,15 @@ sub processpcfgz ($$$$) { return !$st || $ch->{SigOK}{($st & ~128)}; }; + if ($tolerate_bad_fonts && + $r eq 'no bdf data' && + $st_isok->($ch{'gunzip'}) && + ($ch{'pcf2bdf'}{St} & ~128) == 6) + { + $r = "pcf2bdf failed ($ch{'pcf2bdf'}{St})"; + print STDERR "warning: $r: skipping $inpcfgz\n"; + $ch{'pcf2bdf'}{SigOK}{6} = 1; + } foreach my $ch (@children) { if (!$st_isok->($ch)) { die "update-xfonts-traditional:". @@ -443,6 +453,7 @@ our (@options)=( 'share-dir=s' => \$sharedir, 'verbose|v+' => \$verbose, 'j|parallel=i' => \$wanted_parallel, + 'tolerate-bad-fonts!' => \$tolerate_bad_fonts, ); sub define_mode ($$) { diff --git a/update-xfonts-traditional.8 b/update-xfonts-traditional.8 index 54c5cae..5da104c 100644 --- a/update-xfonts-traditional.8 +++ b/update-xfonts-traditional.8 @@ -60,6 +60,11 @@ instead of Use up to .I cpus cores for processing fonts. The default is all the cpus available. +.TP +\fB--no-tolerate-bad-fonts +Treat bad input fonts (eg, ones for which pcf2bdf crashes, or ones +with other problems) as a fatal error. Normally they just produce +a warning. .SH FILES .TP .B xfonts-traditional.done