From 83b6739035fc17d97b8ce01d6a9b9ef6e78d694c Mon Sep 17 00:00:00 2001 From: Patrick Lam Date: Mon, 12 Dec 2005 13:46:45 +0000 Subject: [PATCH] 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. --- ChangeLog | 9 +++++++++ fc-cache/Makefile.am | 5 +++++ fc-cache/fc-cache.c | 4 +++- src/fccache.c | 2 +- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 423528b..f7a0949 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-12-12 Patrick Lam + * 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 reviewed by: plam diff --git a/fc-cache/Makefile.am b/fc-cache/Makefile.am index 5f179f5..fb9a8c9 100644 --- a/fc-cache/Makefile.am +++ b/fc-cache/Makefile.am @@ -29,6 +29,11 @@ SGML = ${FC_CACHE_SRC}/fc-cache.sgml AM_CPPFLAGS = -DPKGCACHEDIR='"${pkgcachedir}"' +pkgcache_DATA=stamp + +stamp: + touch $@ + INCLUDES=-I${top_srcdir} $(FREETYPE_CFLAGS) bin_PROGRAMS=fc-cache diff --git a/fc-cache/fc-cache.c b/fc-cache/fc-cache.c index 388baa7..7acaafe 100644 --- a/fc-cache/fc-cache.c +++ b/fc-cache/fc-cache.c @@ -209,7 +209,9 @@ scanDirs (FcStrList *list, FcConfig *config, char *program, FcBool force, FcBool 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++; } } diff --git a/src/fccache.c b/src/fccache.c index 45413e0..5643d3a 100644 --- a/src/fccache.c +++ b/src/fccache.c @@ -824,7 +824,7 @@ FcDirCacheHashName (char * cache_file, int collisions) if (!tmp) return 0; - cache_hashed = (char *)FcStrPlus ((FcChar8 *)PKGCACHEDIR, tmp); + cache_hashed = (char *)FcStrPlus ((FcChar8 *)PKGCACHEDIR"/", tmp); free (tmp); return cache_hashed;