summaryrefslogtreecommitdiff
path: root/update-xfonts-traditional
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2012-01-08 17:57:53 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2012-01-08 17:57:53 +0000
commitbaaae94921a3f95a4600c2e101384e00fcf34dc2 (patch)
tree0c29207584f3968fd01a2e2ba64e5e9ac672a874 /update-xfonts-traditional
parent1afe886bf3ed9a7457b99f6f2f7775eece731adc (diff)
wip update
Diffstat (limited to 'update-xfonts-traditional')
-rwxr-xr-xupdate-xfonts-traditional34
1 files changed, 34 insertions, 0 deletions
diff --git a/update-xfonts-traditional b/update-xfonts-traditional
index 1daa70c..fbafe0b 100755
--- a/update-xfonts-traditional
+++ b/update-xfonts-traditional
@@ -3,11 +3,14 @@ use strict;
use POSIX;
use IO::File;
use Getopt::Long;
+use File::Glob qw(:glob);
our $prefix="/usr/local";
our $package='xfonts-traditional';
our $sharedir="$prefix/share/$package";
our @fontsdirs=qw(/usr/share/fonts/X11 /usr/local/share/fonts/X11);
+our $donefile="$package.done";
+our $fontprefix="trad--";
our @rulespath;
our $mode;
our %foundrymap;
@@ -148,6 +151,37 @@ sub loadfoundries () {
die "no foundry maps\n" unless %foundrymap;
}
+sub processfontdir ($) {
+ my ($fontdir) = @_;
+ if (!opendir FD, $fontdir) {
+ die "$fontdir $!" unless $!==&ENOENT;
+ return;
+ }
+ my $done = do "$fontdir/$donefile";
+ if (!$done) {
+ die "$fontdir $! $@ " unless $!==&ENOENT;
+ $done = { };
+ }
+ my %found;
+ while (my $dent = readdir FD) {
+ next unless $dent =~ m/^[^.\/].*\.pcf\.gz$/;
+ if ($dent =~ m/^\Q$fontprefix/) {
+ $found{$dent} = 1;
+ next;
+ }
+ if (!stat $dent) {
+ die "$fontdir $dent $!" unless $!==&ENOENT;
+ next;
+ }
+ die "$fontdir $dent" unless -f _;
+ my $stats = join ' ', ((stat _)[1,7,9,10]);
+ $tdone = $done{$dent};
+ if (defined $tdone && $tdone eq $stats) {
+ $found{$dent} = 2;
+ next;
+ }
+
+
our $stdin = new IO::File '<&STDIN' or die $!;
our $stdout = new IO::File '>&STDOUT' or die $!;
our $stderr = new IO::File '>&STDERR' or die $!;