From 30c6d632b398f014cfaeb07dde5e4f7fcee17127 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 8 Jan 2012 19:11:41 +0000 Subject: [PATCH] wip update --- update-xfonts-traditional | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/update-xfonts-traditional b/update-xfonts-traditional index 6063259..e8ed7ab 100755 --- a/update-xfonts-traditional +++ b/update-xfonts-traditional @@ -153,6 +153,17 @@ sub loadfoundries () { die "no foundry maps\n" unless %foundrymap; } +sub processpcfgz ($$) { + my ($inpcfgz,$outpcfgz) = @_; + my $inh = new IO::File $inpcfgz, 'r', or die "$inpcfgz $!"; + my $outh = new IO::File $outpcfgz, 'w' or die "$outpcfgz $!"; + my $inpipe = new IO:Handle or die $!; + my $outpipe = new IO:Handle or die $!; + my $inchild = open $inpipe, "-|"; defined $inchild or die $!; + if (!$inchild) { + + opne + sub processfontdir ($) { my ($fontdir) = @_; if (!opendir FD, $fontdir) { @@ -160,9 +171,9 @@ sub processfontdir ($) { return; } my $olddone = do "$fontdir/$donefile"; - if (!$done) { + if (!$olddone) { die "$fontdir $! $@ " unless $!==&ENOENT; - $done = { }; + $olddone = { }; } my $newdone = { }; my $log = new IO::File "$fontdir/$logfile", "w" @@ -185,7 +196,7 @@ sub processfontdir ($) { } die "$fontdir $dent" unless -f _; my $stats = join ' ', ((stat _)[1,7,9,10]); - $tdone = $olddone->{$dent}; + my $tdone = $olddone->{$dent}; if (defined $tdone && $tdone eq $stats) { $found{$dent} = 2; $newdone->{$dent} = $stats; @@ -193,7 +204,9 @@ sub processfontdir ($) { } my $outdent = $fontprefix.$dent; - my $r = processpcfgz("$fontdir/$dent","$fontdir/$outdent.new"); + my $r = processpcfgz("$fontdir/$dent", + "$fontdir/$outdent.new", + $dent"); if ($r !~ m/^\d/) { print $logfile "%s: unchanged - %s\n", $dent, $r; unlink "$fontdir/$outdent.new" or die "$fontdir $outdent $!"; -- 2.11.0