FcStrSetDestroy (subdirs);
continue;
}
- if (!FcDirScan (set, subdirs, 0, FcConfigGetBlanks (config), dir, force))
+ if (!FcDirScanConfig (set, subdirs, 0, FcConfigGetBlanks (config), dir, force, config))
{
fprintf (stderr, "\"%s\": error scanning\n", dir);
FcFontSetDestroy (set);
ret++;
continue;
}
- if (!force && FcDirCacheValid (dir))
+ if (!force && FcDirCacheValid (dir) && FcDirCacheHasCurrentArch (dir))
{
if (verbose)
printf ("skipping, %d fonts, %d dirs\n",
printf ("caching, %d fonts, %d dirs\n",
set->nfont, nsubdirs (subdirs));
+ if (!FcDirCacheValid (dir))
+ if (!FcDirCacheUnlink (dir))
+ ret++;
+
if (!FcDirSave (set, subdirs, dir))
{
- fprintf (stderr, "Can't save cache in \"%s\"\n", dir);
+ if (!ret)
+ fprintf (stderr, "Caches are currently saved to \"%s\"\n", PKGCACHEDIR);
+ fprintf (stderr, "Can't save cache for \"%s\"\n", dir);
ret++;
}
}
if (systemOnly)
FcConfigEnableHome (FcFalse);
- /* need to use FcInitLoadConfig when we use dirs */
config = FcInitLoadConfig ();
if (!config)
{
fprintf (stderr, "%s: Can't init font config library\n", argv[0]);
return 1;
}
+ FcConfigSetCurrent (config);
if (argv[i])
{