chiark
/
gitweb
/
~ian
/
xfonts-traditional.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1f0fee9
)
better reporting; update mode
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Mon, 9 Jan 2012 03:33:39 +0000
(
03:33
+0000)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Mon, 9 Jan 2012 03:33:39 +0000
(
03:33
+0000)
update-xfonts-traditional
patch
|
blob
|
history
diff --git
a/update-xfonts-traditional
b/update-xfonts-traditional
index 4b71d1407038430a5f44e304c8406741ec1ec3a2..d34157fb3c315549eaab2b922528c64f64de364f 100755
(executable)
--- a/
update-xfonts-traditional
+++ b/
update-xfonts-traditional
@@
-214,18
+214,20
@@
sub processfontdir ($) {
die "$fontdir $!" unless $!==&ENOENT;
return;
}
die "$fontdir $!" unless $!==&ENOENT;
return;
}
+ my $changed = 0;
my $olddone = do "$fontdir/$donefile";
if (!$olddone) {
die "$fontdir $! $@ " unless $!==&ENOENT;
$olddone = { };
my $olddone = do "$fontdir/$donefile";
if (!$olddone) {
die "$fontdir $! $@ " unless $!==&ENOENT;
$olddone = { };
+ $changed = 1;
}
my $newdone = { };
my $log = new IO::File "$fontdir/$logfile", "w"
or die "$fontdir/$logfile $!";
my %outfiles; # bitmask: 1 /*exists*/ | 2 /*wanted*/
}
my $newdone = { };
my $log = new IO::File "$fontdir/$logfile", "w"
or die "$fontdir/$logfile $!";
my %outfiles; # bitmask: 1 /*exists*/ | 2 /*wanted*/
- my $changed;
my $updated=0;
my $reported=0;
my $updated=0;
my $reported=0;
+ my $anypcfs=0;
flush $reportfh or die $!;
while (my $dent = scalar readdir FD) {
flush $reportfh or die $!;
while (my $dent = scalar readdir FD) {
@@
-245,6
+247,8
@@
sub processfontdir ($) {
next;
}
die "$fontdir $dent" unless -f _;
next;
}
die "$fontdir $dent" unless -f _;
+ $anypcfs++;
+
my $stats = join ' ', ((stat _)[1,7,9,10]);
my $tdone = $olddone->{$dent};
my $outdent = $fontprefix.$dent;
my $stats = join ' ', ((stat _)[1,7,9,10]);
my $tdone = $olddone->{$dent};
my $outdent = $fontprefix.$dent;
@@
-265,9
+269,9
@@
sub processfontdir ($) {
or die "$fontdir $outdent $!";
$updated++;
$outfiles{$outdent} |= 3;
or die "$fontdir $outdent $!";
$updated++;
$outfiles{$outdent} |= 3;
- $changed = 1;
}
$newdone->{$dent} = $stats;
}
$newdone->{$dent} = $stats;
+ $changed = 1;
}
my $affected=0;
foreach my $olddent (keys %outfiles) {
}
my $affected=0;
foreach my $olddent (keys %outfiles) {
@@
-279,7
+283,7
@@
sub processfontdir ($) {
unlink "$fontdir/$olddent" or die "$fontdir $olddent $!";
$changed = 1;
}
unlink "$fontdir/$olddent" or die "$fontdir $olddent $!";
$changed = 1;
}
- if (!
%$newdone
) {
+ if (!
$anypcfs
) {
unlink "$fontdir/$logfile" or die "$fontdir $!";
unlink "$fontdir/$donefile" or $!==&ENOENT or die "$fontdir $!";
} elsif ($changed) {
unlink "$fontdir/$logfile" or die "$fontdir $!";
unlink "$fontdir/$donefile" or $!==&ENOENT or die "$fontdir $!";
} elsif ($changed) {
@@
-366,6
+370,14
@@
define_mode('process-fonttrees', sub {
}
});
}
});
+define_mode('update', sub {
+ die "no arguments allowed with --postinst\n" unless !@ARGV;
+ loadfoundries();
+ foreach my $d (@fonttrees) {
+ processfonttree($d);
+ }
+});
+
Getopt::Long::Configure(qw(bundling));
GetOptions(@options) or exit 127;
Getopt::Long::Configure(qw(bundling));
GetOptions(@options) or exit 127;