Commit ea44e218 authored by Patrick Lam's avatar Patrick Lam

Migrate cache files from fonts directories to /var/cache/fontconfig. This

    helps make fontconfig FHS-compliant, but requires that all caches get
    rebuilt.
Also, autogen.sh now needs the additional parameter
--localstatedir=/var.
parent 204da5a8
2005-12-09 Patrick Lam <plam@mit.edu>
* INSTALL:
* configure.in:
* fc-cache/Makefile.am:
* fc-cat/Makefile.am:
* src/Makefile.am:
* fc-cat/fc-cat.c (FcCacheGlobalFileReadAndPrint, FcCacheFileRead):
* fontconfig/fontconfig.h (FC_CACHE_SUFFIX):
* src/fccache.c (FcCacheSkipString, FcGlobalCacheLoad,
FcGlobalCacheSave, FcCacheNextOffset, FcDirCacheValid,
FcDirCacheHasCurrentArch, FcDirCacheHashName,
FcDirCacheOpen, FcDirCacheRead, FcDirCacheWrite):
Migrate cache files from fonts directories to
/var/cache/fontconfig. This helps make fontconfig FHS-compliant,
but requires that all caches get rebuilt.
Also, autogen.sh now needs the additional parameter
--localstatedir=/var.
2005-12-07 Patrick Lam <plam@mit.edu>
* src/fcpat.c (FcPatternAddString):
......
......@@ -18,7 +18,7 @@ important steps:
Set the date
3. Commit those changes
4. rebuild the configuration files with autogen.sh
sh autogen.sh --sysconfdir=/etc --prefix=/usr --mandir=/usr/share/man
sh autogen.sh --sysconfdir=/etc --prefix=/usr --mandir=/usr/share/man --localstatedir=/var
5. make distcheck (NB: won't work without docbook-utils -PL)
6. tag the tree
cvs tag fc-2_2_xx
......
......@@ -479,6 +479,13 @@ fi
AC_SUBST(DOCDIR)
#
# Make /var/cache/fontconfig directory available to source code
#
pkgcachedir='${localstatedir}/cache/'${PACKAGE}
AC_SUBST(pkgcachedir)
AC_OUTPUT([
Makefile
fontconfig/Makefile
......
......@@ -27,6 +27,8 @@ FC_CACHE_SRC=${top_srcdir}/fc-cache
SGML = ${FC_CACHE_SRC}/fc-cache.sgml
AM_CPPFLAGS = -DPKGCACHEDIR='"${pkgcachedir}"'
INCLUDES=-I${top_srcdir} $(FREETYPE_CFLAGS)
bin_PROGRAMS=fc-cache
......
......@@ -27,6 +27,8 @@ FC_CAT_SRC=${top_srcdir}/fc-cat
SGML = ${FC_CAT_SRC}/fc-cat.sgml
AM_CPPFLAGS = -DPKGCACHEDIR='"${pkgcachedir}"'
INCLUDES=-I${top_srcdir} $(FREETYPE_CFLAGS)
bin_PROGRAMS=fc-cat
......
......@@ -184,7 +184,8 @@ FcCacheGlobalFileReadAndPrint (FcFontSet * set, FcStrSet *dirs, char * dir, char
if (fd == -1)
goto bail;
current_arch_start = FcCacheSkipToArch(fd, current_arch_machine_name);
current_arch_start = FcCacheSkipToArch(fd, current_arch_machine_name,
FcTrue);
if (current_arch_start < 0)
goto bail1;
......@@ -225,6 +226,7 @@ FcCacheFileRead (FcFontSet * set, FcStrSet *dirs, char * dir, char *cache_file)
char candidate_arch_machine_name[9+MACHINE_SIGNATURE_SIZE];
off_t current_arch_start = 0;
char subdirName[FC_MAX_FILE_LEN + 1 + 12 + 1];
char name_buf[8192];
if (!cache_file)
goto bail;
......@@ -234,7 +236,14 @@ FcCacheFileRead (FcFontSet * set, FcStrSet *dirs, char * dir, char *cache_file)
if (fd == -1)
goto bail;
current_arch_start = FcCacheSkipToArch(fd, current_arch_machine_name);
FcCacheReadString (fd, name_buf, sizeof (name_buf));
if (!strlen (name_buf))
goto bail;
printf ("fc-cat: printing directory cache contents for dir %s\n",
name_buf);
current_arch_start = FcCacheSkipToArch(fd, current_arch_machine_name,
FcFalse);
if (current_arch_start < 0)
goto bail1;
......
......@@ -104,6 +104,7 @@ typedef int FcBool;
#define FC_EMBOLDEN "embolden" /* Bool - true if emboldening needed*/
#define FC_EMBEDDED_BITMAP "embeddedbitmap" /* Bool - true to enable embedded bitmaps */
#define FC_CACHE_SUFFIX ".cache-"FC_CACHE_VERSION
#define FC_DIR_CACHE_FILE "fonts.cache-"FC_CACHE_VERSION
#define FC_USER_CACHE_FILE ".fonts.cache-"FC_CACHE_VERSION
......
......@@ -63,6 +63,8 @@ uninstall-ms-import-lib:
endif
AM_CPPFLAGS = -DPKGCACHEDIR='"${pkgcachedir}"'
INCLUDES = \
$(FREETYPE_CFLAGS) \
$(LIBXML2_CFLAGS) \
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment