Improve error message when fc-cache can't write the cache. Add missing

slash. Reported by Behdad. Incorporate Behdad's patch to create
    /var/cache/fontconfig when appropriate.
This commit is contained in:
Patrick Lam 2005-12-12 13:46:45 +00:00
parent 368104c381
commit 83b6739035
4 changed files with 18 additions and 2 deletions

View File

@ -1,3 +1,12 @@
2005-12-12 Patrick Lam <plam@mit.edu>
* fc-cache/fc-cache.c (scanDirs):
* fc-cache/Makefile.am:
* src/fccache.c (FcDirCacheHashName):
Improve error message when fc-cache can't write the cache. Add
missing slash. Reported by Behdad. Incorporate Behdad's patch to
create /var/cache/fontconfig when appropriate.
2005-12-12 Behdad Esfahbod <behdad@cs.toronto.edu> 2005-12-12 Behdad Esfahbod <behdad@cs.toronto.edu>
reviewed by: plam reviewed by: plam

View File

@ -29,6 +29,11 @@ SGML = ${FC_CACHE_SRC}/fc-cache.sgml
AM_CPPFLAGS = -DPKGCACHEDIR='"${pkgcachedir}"' AM_CPPFLAGS = -DPKGCACHEDIR='"${pkgcachedir}"'
pkgcache_DATA=stamp
stamp:
touch $@
INCLUDES=-I${top_srcdir} $(FREETYPE_CFLAGS) INCLUDES=-I${top_srcdir} $(FREETYPE_CFLAGS)
bin_PROGRAMS=fc-cache bin_PROGRAMS=fc-cache

View File

@ -209,7 +209,9 @@ scanDirs (FcStrList *list, FcConfig *config, char *program, FcBool force, FcBool
if (!FcDirSave (set, subdirs, dir)) 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++; ret++;
} }
} }

View File

@ -824,7 +824,7 @@ FcDirCacheHashName (char * cache_file, int collisions)
if (!tmp) if (!tmp)
return 0; return 0;
cache_hashed = (char *)FcStrPlus ((FcChar8 *)PKGCACHEDIR, tmp); cache_hashed = (char *)FcStrPlus ((FcChar8 *)PKGCACHEDIR"/", tmp);
free (tmp); free (tmp);
return cache_hashed; return cache_hashed;