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 0 // put this back later after fixing DirCacheValid
- if (!force && FcDirCacheValid (dir))
+ if (!force && FcDirCacheValid (dir) && FcDirCacheHasCurrentArch (dir))
{
if (verbose)
printf ("skipping, %d fonts, %d dirs\n",
set->nfont, nsubdirs(subdirs));
}
else
-#endif
{
if (verbose)
printf ("caching, %d fonts, %d dirs\n",
set->nfont, nsubdirs (subdirs));
- if (!FcDirSave (set, dir))
+ 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);
- FcCacheForce (FcTrue);
- /* need to use FcInitLoadConfig when we use dirs */
- FcInit ();
- config = FcConfigGetCurrent ();
+ config = FcInitLoadConfig ();
if (!config)
{
fprintf (stderr, "%s: Can't init font config library\n", argv[0]);