X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=xfonts-traditional.git;a=blobdiff_plain;f=update-xfonts-traditional;h=a2e81e0e3fa5ebaca61a606c68eec8f723f4a7d2;hp=63e9040d4a5572a8e14ba842526a48644c0a0621;hb=0c09768ac8cbf1b78d9672c336dc4c1d2ab49339;hpb=1987c934200d2f253320fc7b2c1c05827c9bc9cd diff --git a/update-xfonts-traditional b/update-xfonts-traditional index 63e9040..a2e81e0 100755 --- a/update-xfonts-traditional +++ b/update-xfonts-traditional @@ -24,6 +24,7 @@ our $reportfh; our $foundryinfo; our %props; our $tolerate_bad_fonts=1; +our $always_reprocess; our $wanted_parallel; sub reportloaded { @@ -159,7 +160,7 @@ sub loadfoundries () { while (<$f>) { s/^\s*//; s/\s+$//; next if m/^\#/; - m/^(\w+)\s+(\w+)$/ or die; + m/^([.0-9A-Za-z]+)\s+([.0-9A-Za-z]+)$/ or die; my $k = lc $1; next if exists $foundrymap{$k}; $foundrymap{$k}=$2; @@ -170,6 +171,12 @@ sub loadfoundries () { die "no foundry maps\n" unless %foundrymap; } +sub filter_st_isok ($) { + my ($ch) = @_; + my $st = $ch->{St}; + return !$st || $ch->{SigOK}{($st & ~128)}; +} + sub processpcfgz ($$$$) { my ($inpcfgz,$outpcfgz,$logfile,$what) = @_; print $reportfh "processing $inpcfgz to $outpcfgz\n" if $verbose>=2; @@ -254,15 +261,9 @@ sub processpcfgz ($$$$) { $ch->{St} = $?; } - my $st_isok = sub { - my ($ch) = @_; - my $st = $ch->{St}; - return !$st || $ch->{SigOK}{($st & ~128)}; - }; - if ($tolerate_bad_fonts && $r eq 'no bdf data' && - $st_isok->($ch{'gunzip'}) && + filter_st_isok($ch{'gunzip'}) && ($ch{'pcf2bdf'}{St} & ~128) == 6) { $r = "pcf2bdf failed ($ch{'pcf2bdf'}{St})"; @@ -270,7 +271,7 @@ sub processpcfgz ($$$$) { $ch{'pcf2bdf'}{SigOK}{6} = 1; } foreach my $ch (@children) { - if (!$st_isok->($ch)) { + if (!filter_st_isok($ch)) { die "update-xfonts-traditional:". " $ch->{Exe} [$ch->{Pid}] for $inpcfgz". " failed $ch->{St}". @@ -287,14 +288,17 @@ sub processfontdir ($) { return; } my $changed = 0; - my $olddone = do "$fontdir/$donefile"; - if (!$olddone) { - die "$fontdir $! $@ " unless $!==&ENOENT; - } elsif ($olddone->{''} ne $foundryinfo) { - our $repro_reported; - print $reportfh "reprocessing fonts (rules updated)\n" or die $! - unless $repro_reported++; - $olddone = undef; + my $olddone; + if (!$always_reprocess) { + $olddone = do "$fontdir/$donefile"; + if (!$olddone) { + die "$fontdir $! $@ " unless $!==&ENOENT; + } elsif ($olddone->{''} ne $foundryinfo) { + our $repro_reported; + print $reportfh "reprocessing fonts (rules updated)\n" or die $! + unless $repro_reported++; + $olddone = undef; + } } if (!$olddone) { $olddone = { }; @@ -453,6 +457,7 @@ our (@options)=( 'share-dir=s' => \$sharedir, 'verbose|v+' => \$verbose, 'j|parallel=i' => \$wanted_parallel, + 'always-reprocess!' => \$always_reprocess, 'tolerate-bad-fonts!' => \$tolerate_bad_fonts, );