summaryrefslogtreecommitdiff
path: root/update-xfonts-traditional
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2012-01-09 21:16:16 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2012-01-09 21:16:16 +0000
commit6dd0b06bb8ff014a315446417c91c7b5ce9e3132 (patch)
tree70f7480f1af8e76304b39bef84dddeb9af623409 /update-xfonts-traditional
parent489ffe219bed26ff9669f17750c08d4d9f867b60 (diff)
reprocess when needed
Diffstat (limited to 'update-xfonts-traditional')
-rwxr-xr-xupdate-xfonts-traditional25
1 files changed, 23 insertions, 2 deletions
diff --git a/update-xfonts-traditional b/update-xfonts-traditional
index df71fce..839cc18 100755
--- a/update-xfonts-traditional
+++ b/update-xfonts-traditional
@@ -20,12 +20,17 @@ our $mode;
our %foundrymap;
our $verbose=0;
our $reportfh;
+our $foundryinfo;
sub reportloaded {
return unless $verbose;
print $reportfh @_,"\n" or die $!;
}
+sub statsummary () {
+ return join ' ', ((stat _)[1,7,9,10]);
+}
+
sub loadrules ($) {
my ($key) = @_;
our %cache;
@@ -119,7 +124,14 @@ sub processbdf ($$$$) {
}
sub loadfoundries () {
+ $foundryinfo = '';
foreach my $path (@rulespath) {
+ if (!stat $path) {
+ die "$path $!" unless $!==&ENOENT;
+ next;
+ }
+ $foundryinfo .= statsummary().' '.$path."\0\n";
+
my $p = "$path/foundries";
my $f = new IO::File $p;
if (!$f) {
@@ -127,6 +139,7 @@ sub loadfoundries () {
print $reportfh "foundries: none in $p\n" or die $! if $verbose;
next;
}
+ stat $f or die $!;
while (<$f>) {
s/^\s*//; s/\s+$//;
next if m/^\#/;
@@ -218,10 +231,18 @@ sub processfontdir ($) {
my $olddone = do "$fontdir/$donefile";
if (!$olddone) {
die "$fontdir $! $@ " unless $!==&ENOENT;
+ }
+ if ($olddone && $olddone->{''} ne $foundryinfo) {
+ our $repro_reported;
+ print $reportfh "reprocessing fonts (rules updated)\n" or die $!
+ unless $repro_reported++;
+ $olddone = undef;
+ }
+ if (!$olddone) {
$olddone = { };
$changed = 1;
}
- my $newdone = { };
+ my $newdone = { '' => $foundryinfo };
my $log = new IO::File "$fontdir/$logfile", "w"
or die "$fontdir/$logfile $!";
my %outfiles; # bitmask: 1 /*exists*/ | 2 /*wanted*/
@@ -249,7 +270,7 @@ sub processfontdir ($) {
die "$fontdir $dent" unless -f _;
$anypcfs++;
- my $stats = join ' ', ((stat _)[1,7,9,10]);
+ my $stats = statsummary();
my $tdone = $olddone->{$dent};
my $outdent = $fontprefix.$dent;
if (defined $tdone && $tdone eq $stats) {