rpms/fontconfig/devel fontconfig-2.3.93.cvs20060131-move-user-cache.patch, 1.1, 1.2 fontconfig.spec, 1.63, 1.64

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Fri Feb 3 20:05:40 UTC 2006


Author: rstrode

Update of /cvs/dist/rpms/fontconfig/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv7687

Modified Files:
	fontconfig-2.3.93.cvs20060131-move-user-cache.patch 
	fontconfig.spec 
Log Message:
- Move user cache to a subdirectory (bug 160275)


fontconfig-2.3.93.cvs20060131-move-user-cache.patch:
 fontconfig/fontconfig.h |    1 +
 src/fccache.c           |   18 +++++++++++++++++-
 src/fccfg.c             |    2 +-
 3 files changed, 19 insertions(+), 2 deletions(-)

Index: fontconfig-2.3.93.cvs20060131-move-user-cache.patch
===================================================================
RCS file: /cvs/dist/rpms/fontconfig/devel/fontconfig-2.3.93.cvs20060131-move-user-cache.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- fontconfig-2.3.93.cvs20060131-move-user-cache.patch	2 Feb 2006 23:13:50 -0000	1.1
+++ fontconfig-2.3.93.cvs20060131-move-user-cache.patch	3 Feb 2006 20:05:35 -0000	1.2
@@ -1,92 +1,48 @@
---- fontconfig-2.3.93.cvs20060131/src/fccfg.c.move-user-cache	2006-02-02 16:06:27.000000000 -0500
-+++ fontconfig-2.3.93.cvs20060131/src/fccfg.c	2006-02-02 16:06:27.000000000 -0500
-@@ -1755,14 +1755,50 @@
- {
-     if (_FcConfigHomeEnabled)
-     {
--        char *home = getenv ("HOME");
-+        static FcChar8 *fc_home = NULL;
-+
-+        const char *home = getenv ("HOME");
-+
-+	if (home != NULL)
-+	{
-+            FcBool appended_ok;
-+            FcStrBuf buf;
-+            FcStrBufInit (&buf, 0, 0);
-+	    appended_ok = FcStrBufString (&buf, (const FcChar8 *) home);
-+
-+            if (appended_ok)
-+		appended_ok = FcStrBufChar (&buf, '/');
-+
-+	    if (appended_ok)
-+	        appended_ok = FcStrBufString (&buf, (const FcChar8 *) FC_USER_CACHE_DIR);
-+                
-+            if (appended_ok)
-+		fc_home = FcStrBufDone (&buf);
-+	}
- 
- #ifdef _WIN32
- 	if (home == NULL)
- 	    home = getenv ("USERPROFILE");
-+
-+	if (home != NULL)
-+	{
-+            FcBool appended_ok;
-+            FcStrBuf buf;
-+            FcStrBufInit (&buf, 0, 0);
-+	    appended_ok = FcStrBufString (&buf, (const FcChar8 *) home);
-+
-+            if (appended_ok)
-+		appended_ok = FcStrBufChar (&buf, '/');
-+
-+	    if (appended_ok)
-+	        appended_ok = FcStrBufString (&buf, (const FcChar8 *) FC_USER_CACHE_DIR);
-+                
-+            if (appended_ok)
-+		fc_home = FcStrBufDone (&buf);
-+	}
- #endif
+--- fontconfig-2.3.93.cvs20060131/src/fccache.c.move-user-cache	2006-02-03 14:26:31.000000000 -0500
++++ fontconfig-2.3.93.cvs20060131/src/fccache.c	2006-02-03 14:26:31.000000000 -0500
+@@ -446,7 +446,23 @@
+ 	return FcFalse;
  
--	return (FcChar8 *) home;
-+	return (FcChar8 *) fc_home;
-     }
-     return 0;
- }
---- fontconfig-2.3.93.cvs20060131/src/fccache.c.move-user-cache	2006-02-02 16:06:27.000000000 -0500
-+++ fontconfig-2.3.93.cvs20060131/src/fccache.c	2006-02-02 16:15:30.000000000 -0500
-@@ -449,6 +449,24 @@
- 	goto bail1;
-     fd = open ((char *) FcAtomicNewFile(atomic), O_RDWR | O_CREAT, 
- 	       S_IRUSR | S_IWUSR);
-+    if (fd == -1 && errno == ENOENT)
+     if (!FcAtomicLock (atomic))
+-	goto bail1;
 +    {
-+	FcChar8 *cache_dir;
-+          
-+        cache_dir = FcStrDirname (cache_file);
++      FcChar8 *cache_dir;
 +
-+        /* quick last ditch effort to try to make the
-+         * dir if it doesn't exist.  This doesn't support
-+         * making more than one component of the path
-+         * and is broken in the WIN32 case.
-+         */
-+	mkdir ((char *) cache_dir, 0777);
-+        FcStrFree (cache_dir);
++      cache_dir = FcStrDirname (cache_file);
 +
-+        fd = open ((char *) FcAtomicNewFile(atomic), O_RDWR | O_CREAT, 
-+	           S_IRUSR | S_IWUSR);
++      /* quick last ditch effort to try to make the dir in the
++       * off chance it doesn't exist.  This doesn't support
++       * making more than one component of the path and is
++       * broken in the WIN32 case.
++       */
++      mkdir ((char *) cache_dir, 0777);
++      FcStrFree (cache_dir);
++
++      if (!FcAtomicLock (atomic))
++        goto bail1;
 +    }
 +
+     fd = open ((char *) FcAtomicNewFile(atomic), O_RDWR | O_CREAT, 
+ 	       S_IRUSR | S_IWUSR);
      if (fd == -1)
- 	goto bail2;
-     FcCacheWriteString (fd, FC_GLOBAL_MAGIC_COOKIE);
+--- fontconfig-2.3.93.cvs20060131/src/fccfg.c.move-user-cache	2006-02-03 14:26:31.000000000 -0500
++++ fontconfig-2.3.93.cvs20060131/src/fccfg.c	2006-02-03 14:50:05.000000000 -0500
+@@ -79,7 +79,7 @@
+ 
+     config->cache = 0;
+     if (FcConfigHome())
+-	if (!FcConfigSetCache (config, (FcChar8 *) ("~/" FC_USER_CACHE_FILE)))
++	if (!FcConfigSetCache (config, (FcChar8 *) ("~/" FC_USER_CACHE_DIR "/" FC_USER_CACHE_FILE)))
+ 	    goto bail8;
+ 
+ #ifdef _WIN32
 --- fontconfig-2.3.93.cvs20060131/fontconfig/fontconfig.h.move-user-cache	2006-01-27 09:36:11.000000000 -0500
-+++ fontconfig-2.3.93.cvs20060131/fontconfig/fontconfig.h	2006-02-02 16:06:27.000000000 -0500
++++ fontconfig-2.3.93.cvs20060131/fontconfig/fontconfig.h	2006-02-03 14:26:31.000000000 -0500
 @@ -106,6 +106,7 @@
  
  #define FC_CACHE_SUFFIX		    ".cache-"FC_CACHE_VERSION
  #define FC_DIR_CACHE_FILE	    "fonts.cache-"FC_CACHE_VERSION
-+#define FC_USER_CACHE_DIR	    ".rh-fontconfig/"
++#define FC_USER_CACHE_DIR	    ".rh-fontconfig"
  #define FC_USER_CACHE_FILE	    ".fonts.cache-"FC_CACHE_VERSION
  
  /* Adjust outline rasterizer */


Index: fontconfig.spec
===================================================================
RCS file: /cvs/dist/rpms/fontconfig/devel/fontconfig.spec,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- fontconfig.spec	2 Feb 2006 23:13:50 -0000	1.63
+++ fontconfig.spec	3 Feb 2006 20:05:35 -0000	1.64
@@ -60,7 +60,7 @@
 %patch4 -p1 -b .fontconfig-misc-warning-fixes
 %patch5 -p0 -b .fontconfig-fccache-update-check
 %patch6 -p0 -b .fontconfig-seife-crash
-#%patch7 -p1 -b .move-user-cache
+%patch7 -p1 -b .move-user-cache
 
 %build
 %configure --with-add-fonts=/usr/share/X11/fonts/Type1,/usr/share/X11/fonts/OTF




More information about the fedora-cvs-commits mailing list