summaryrefslogtreecommitdiffstats
path: root/move/tools/fix-fc-cache.pl
diff options
context:
space:
mode:
Diffstat (limited to 'move/tools/fix-fc-cache.pl')
-rwxr-xr-xmove/tools/fix-fc-cache.pl21
1 files changed, 21 insertions, 0 deletions
diff --git a/move/tools/fix-fc-cache.pl b/move/tools/fix-fc-cache.pl
new file mode 100755
index 000000000..e0eb19fa0
--- /dev/null
+++ b/move/tools/fix-fc-cache.pl
@@ -0,0 +1,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";
+ }
+ }
+}
+