[115782] trunk/dports/graphics/fontconfig

jeremyhu at macports.org jeremyhu at macports.org
Fri Jan 10 21:56:18 PST 2014


Revision: 115782
          https://trac.macports.org/changeset/115782
Author:   jeremyhu at macports.org
Date:     2014-01-10 21:56:18 -0800 (Fri, 10 Jan 2014)
Log Message:
-----------
fontconfig: Fix cache invalidation when font subdirectories exist (maintainer timeout)

Modified Paths:
--------------
    trunk/dports/graphics/fontconfig/Portfile

Added Paths:
-----------
    trunk/dports/graphics/fontconfig/files/0001-Revert-Workaround-the-race-condition-issue-on-updati.patch

Modified: trunk/dports/graphics/fontconfig/Portfile
===================================================================
--- trunk/dports/graphics/fontconfig/Portfile	2014-01-11 05:01:10 UTC (rev 115781)
+++ trunk/dports/graphics/fontconfig/Portfile	2014-01-11 05:56:18 UTC (rev 115782)
@@ -6,7 +6,7 @@
 
 name                        fontconfig
 version                     2.11.0
-revision                    1
+revision                    2
 categories                  graphics
 maintainers                 ryandesign
 license                     fontconfig
@@ -39,7 +39,8 @@
 lappend add_fonts           ${prefix}/share/fonts
 set docdir                  ${prefix}/share/doc/${name}
 
-patchfiles                  patch-docbook-4.2.diff
+patchfiles                  patch-docbook-4.2.diff \
+                            0001-Revert-Workaround-the-race-condition-issue-on-updati.patch
 
 configure.args              --disable-silent-rules HASDOCBOOK=no
 

Added: trunk/dports/graphics/fontconfig/files/0001-Revert-Workaround-the-race-condition-issue-on-updati.patch
===================================================================
--- trunk/dports/graphics/fontconfig/files/0001-Revert-Workaround-the-race-condition-issue-on-updati.patch	                        (rev 0)
+++ trunk/dports/graphics/fontconfig/files/0001-Revert-Workaround-the-race-condition-issue-on-updati.patch	2014-01-11 05:56:18 UTC (rev 115782)
@@ -0,0 +1,162 @@
+From e6f5880b2bb97e286e9609869384a57d5b3756ff Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
+Date: Mon, 4 Nov 2013 15:28:07 -0800
+Subject: [PATCH] Revert "Workaround the race condition issue on updating
+ cache"
+
+Fix 90 second start time regression in XQuartz
+
+This reverts commit 0203055520206028eecee5d261887cdc91500e15.
+---
+ fc-cache/fc-cache.c     | 62 +++++++++++++++++++++----------------------------
+ fontconfig/fontconfig.h |  3 ---
+ src/fcstr.c             |  6 -----
+ 3 files changed, 26 insertions(+), 45 deletions(-)
+
+diff --git a/fc-cache/fc-cache.c b/fc-cache/fc-cache.c
+index af7ba6d..aeb0af2 100644
+--- fc-cache/fc-cache.c
++++ fc-cache/fc-cache.c
+@@ -118,7 +118,7 @@ usage (char *program, int error)
+ static FcStrSet *processed_dirs;
+ 
+ static int
+-scanDirs (FcStrList *list, FcConfig *config, FcBool force, FcBool really_force, FcBool verbose, FcBool recursive, int *changed)
++scanDirs (FcStrList *list, FcConfig *config, FcBool force, FcBool really_force, FcBool verbose, int *changed)
+ {
+     int		    ret = 0;
+     const FcChar8   *dir;
+@@ -141,7 +141,7 @@ scanDirs (FcStrList *list, FcConfig *config, FcBool force, FcBool really_force,
+ 	    fflush (stdout);
+ 	}
+ 	
+-	if (recursive && FcStrSetMember (processed_dirs, dir))
++	if (FcStrSetMember (processed_dirs, dir))
+ 	{
+ 	    if (verbose)
+ 		printf ("skipping, looped directory detected\n");
+@@ -213,37 +213,32 @@ scanDirs (FcStrList *list, FcConfig *config, FcBool force, FcBool really_force,
+ 		ret++;
+ 	    }
+ 	}
+-
+-	if (recursive)
+-	{
+-	    subdirs = FcStrSetCreate ();
+-	    if (!subdirs)
+-	    {
+-		fprintf (stderr, "%s: Can't create subdir set\n", dir);
+-		ret++;
+-		FcDirCacheUnload (cache);
+-		continue;
+-	    }
+-	    for (i = 0; i < FcCacheNumSubdir (cache); i++)
+-		FcStrSetAdd (subdirs, FcCacheSubdir (cache, i));
+ 	
++	subdirs = FcStrSetCreate ();
++	if (!subdirs)
++	{
++	    fprintf (stderr, "%s: Can't create subdir set\n", dir);
++	    ret++;
+ 	    FcDirCacheUnload (cache);
++	    continue;
++	}
++	for (i = 0; i < FcCacheNumSubdir (cache); i++)
++	    FcStrSetAdd (subdirs, FcCacheSubdir (cache, i));
+ 	
+-	    sublist = FcStrListCreate (subdirs);
+-	    FcStrSetDestroy (subdirs);
+-	    if (!sublist)
+-	    {
+-		fprintf (stderr, "%s: Can't create subdir list\n", dir);
+-		ret++;
+-		continue;
+-	    }
+-	    FcStrSetAdd (processed_dirs, dir);
+-	    ret += scanDirs (sublist, config, force, really_force, verbose, recursive, changed);
+-	    FcStrListDone (sublist);
++	FcDirCacheUnload (cache);
++	
++	sublist = FcStrListCreate (subdirs);
++	FcStrSetDestroy (subdirs);
++	if (!sublist)
++	{
++	    fprintf (stderr, "%s: Can't create subdir list\n", dir);
++	    ret++;
++	    continue;
+ 	}
+-	else
+-	    FcDirCacheUnload (cache);
++	FcStrSetAdd (processed_dirs, dir);
++	ret += scanDirs (sublist, config, force, really_force, verbose, changed);
+     }
++    FcStrListDone (list);
+     return ret;
+ }
+ 
+@@ -371,11 +366,7 @@ main (int argc, char **argv)
+     }
+ 	
+     changed = 0;
+-    ret = scanDirs (list, config, force, really_force, verbose, FcTrue, &changed);
+-    /* Update the directory cache again to avoid the race condition as much as possible */
+-    FcStrListFirst (list);
+-    ret += scanDirs (list, config, FcTrue, really_force, verbose, FcFalse, &changed);
+-    FcStrListDone (list);
++    ret = scanDirs (list, config, force, really_force, verbose, &changed);
+ 
+     /*
+      * Try to create CACHEDIR.TAG anyway.
+@@ -388,8 +379,6 @@ main (int argc, char **argv)
+ 
+     cleanCacheDirectories (config, verbose);
+ 
+-    FcConfigDestroy (config);
+-    FcFini ();
+     /* 
+      * 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
+@@ -397,7 +386,8 @@ main (int argc, char **argv)
+      * sleep(3) can't be interrupted by a signal here -- this isn't in the
+      * library, and there aren't any signals flying around here.
+      */
+-    /* the resolution of mtime on FAT is 2 seconds */
++    FcConfigDestroy (config);
++    FcFini ();
+     if (changed)
+ 	sleep (2);
+     if (verbose)
+diff --git a/fontconfig/fontconfig.h b/fontconfig/fontconfig.h
+index dfc48f9..e2c32fe 100644
+--- fontconfig/fontconfig.h
++++ fontconfig/fontconfig.h
+@@ -974,9 +974,6 @@ FcStrSetDestroy (FcStrSet *set);
+ FcPublic FcStrList *
+ FcStrListCreate (FcStrSet *set);
+ 
+-FcPublic void
+-FcStrListFirst (FcStrList *list);
+-
+ FcPublic FcChar8 *
+ FcStrListNext (FcStrList *list);
+ 
+diff --git a/src/fcstr.c b/src/fcstr.c
+index 5707172..3a32031 100644
+--- src/fcstr.c
++++ src/fcstr.c
+@@ -1374,12 +1374,6 @@ FcStrListCreate (FcStrSet *set)
+     return list;
+ }
+ 
+-void
+-FcStrListFirst (FcStrList *list)
+-{
+-    list->n = 0;
+-}
+-
+ FcChar8 *
+ FcStrListNext (FcStrList *list)
+ {
+-- 
+1.8.4.1
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140110/313e58ac/attachment.html>


More information about the macports-changes mailing list