chiark / gitweb /
update-xfonts-traditional: Break out filter_st_isok (no functional change)
[xfonts-traditional.git] / update-xfonts-traditional
index 895be6d5671bcda3db31455eccac0c2da3373572..a2e81e0e3fa5ebaca61a606c68eec8f723f4a7d2 100755 (executable)
@@ -160,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;
@@ -171,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;
@@ -255,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})";
@@ -271,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}".