summaryrefslogtreecommitdiffstats
path: root/move/tools/check-fc-cache.pl
blob: 42902835fc85f1e60426ea1e5401958bb1af9cb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/perl

# check if files are more recent (fc-cache will slow down starting of drakx)

use MDK::Common;

sub stat_ {
    my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat $_[0];
    max($mtime, $ctime);
}

my $prefix = $ARGV[0] || '/tmp/live_tree';

my @conf = cat_("$prefix/etc/fonts/fonts.conf");

foreach my $line (@conf) {
    while ($line =~ m|<dir>([^<]+)</dir|g) {
        my $dir = $1;
        $dir =~ m|^/| or next;
        print "dir $prefix$dir\n";
        foreach my $d (chomp_(`find $prefix$dir -type d 2>/dev/null`)) {
            my $ref = stat_("$d/fonts.cache-1");
            stat_($_) > $ref and print "\t$_\n" foreach glob("$d/*");
        }
    }
}