chiark / gitweb /
Normalise bdfs before all rule generation and on-system processing
[xfonts-traditional.git] / update-xfonts-traditional
index 8dccad424924f88c36c012ceab5cc6a69a72cc14..494d637969ddcf53db31e94c9201ccc45d3518c0 100755 (executable)
@@ -16,6 +16,7 @@ our @fonttrees=qw(/usr/share/fonts/X11 /usr/local/share/fonts/X11);
 our $donefile="$package.done";
 our $logfile="$package.log";
 our $fontprefix="trad--";
 our $donefile="$package.done";
 our $logfile="$package.log";
 our $fontprefix="trad--";
+our $bdfnorm="bdfnorm";
 our @rulespath;
 our $mode;
 our %foundrymap;
 our @rulespath;
 our $mode;
 our %foundrymap;
@@ -241,16 +242,23 @@ sub process_filter ($$$$$$$$) {
        # for some other reason then sending it a KILL now won't
        # affect its exit status.)  We kill the output filters (before
        # we close the output pipe) so we don't produce messages from
        # for some other reason then sending it a KILL now won't
        # affect its exit status.)  We kill the output filters (before
        # we close the output pipe) so we don't produce messages from
-       # our output filters about corrupted data.
+       # our output filters about corrupted data.  And we tolerate
+       # SIGPIPE in all the input filters.
        flush $uswrite or die $!;
 
        flush $uswrite or die $!;
 
+       my $filterkind = 'input';
        foreach my $ch (@children) {
            if ($ch->{Stage} ne 'self') {
                kill 9, $ch->{Pid} or die "$ch->{Pid} $ch->{Exe} $!";
                $ch->{SigOK}{9} = 1;
        foreach my $ch (@children) {
            if ($ch->{Stage} ne 'self') {
                kill 9, $ch->{Pid} or die "$ch->{Pid} $ch->{Exe} $!";
                $ch->{SigOK}{9} = 1;
+           } else {
+               $filterkind = 'output';
+               next;
+           }
+           if ($filterkind eq 'input') {
+               $ch->{SigOK}{13} = 1;
            }
        }
            }
        }
-       $ch{'pcf2bdf'}{SigOK}{13} = 1;
        # ... we might not have read all the output from pcf2bdf, which is OK
     }
 
        # ... we might not have read all the output from pcf2bdf, which is OK
     }
 
@@ -284,7 +292,7 @@ sub processpcfgz ($$$$) {
     my $r;
     process_filter(\$r, $input, $output, $inpcfgz, $logfh,
         [
     my $r;
     process_filter(\$r, $input, $output, $inpcfgz, $logfh,
         [
-           ['gunzip'], ['pcf2bdf'],
+           ['gunzip'], ['pcf2bdf'], [$bdfnorm],
            [],
            ['bdftopcf'],['',qw(gzip -1 -n)]
        ],
            [],
            ['bdftopcf'],['',qw(gzip -1 -n)]
        ],
@@ -541,6 +549,7 @@ Getopt::Long::Configure(qw(bundling));
 GetOptions(@options) or exit 127;
 
 push @rulespath, "$sharedir/rules";
 GetOptions(@options) or exit 127;
 
 push @rulespath, "$sharedir/rules";
+$bdfnorm = "$sharedir/$bdfnorm";
 
 die "need a mode\n" unless $mode;
 
 
 die "need a mode\n" unless $mode;