exit (1);
}
-#if 0
static int
nsubdirs (FcStrSet *set)
{
ret++;
continue;
}
- if (!force && FcDirCacheValid (dir))
+ if (!force && FcDirCacheValid (dir) && FcDirCacheHasCurrentArch (dir))
{
if (verbose)
printf ("skipping, %d fonts, %d dirs\n",
if (verbose)
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++;
}
}
FcStrListDone (list);
return ret;
}
-#endif
int
main (int argc, char **argv)
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]);
return 1;
}
- /* We don't yet have per-directory caches. */
- ret = (FcCacheWrite (config) == FcFalse);
-
-#if 0
if (argv[i])
{
dirs = FcStrSetCreate ();
else
list = FcConfigGetConfigDirs (config);
ret = scanDirs (list, config, argv[0], force, verbose);
-#endif
/*
* Now we need to sleep a second (or two, to be extra sure), to make
* sure that timestamps for changes after this run of fc-cache are later