summaryrefslogtreecommitdiffstats
path: root/move/tools/fix-fc-cache.pl
blob: e0eb19fa02eec76ef3a3a38e8571bdfb52acab8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/perl

# touch fontconfig cache files so that fc-cache will not slow down starting of drakx

use MDK::Common;

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

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

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