diff --git a/fontconfig-0-timestamp-dir-on-sb.patch b/fontconfig-0-timestamp-dir-on-sb.patch new file mode 100644 index 0000000..cfbc206 --- /dev/null +++ b/fontconfig-0-timestamp-dir-on-sb.patch @@ -0,0 +1,55 @@ +diff --git a/src/fccache.c b/src/fccache.c +index 2d398c73..7139b082 100644 +--- a/src/fccache.c ++++ b/src/fccache.c +@@ -845,7 +845,7 @@ FcCacheTimeValid (FcConfig *config, FcCache *cache, struct stat *dir_stat) + FcCacheDir (cache), cache->checksum, (int) dir_stat->st_mtime); + #endif + +- return cache->checksum == (int) dir_stat->st_mtime && fnano; ++ return dir_stat->st_mtime == 0 || (cache->checksum == (int) dir_stat->st_mtime && fnano); + } + + static FcBool +@@ -1041,17 +1041,39 @@ static FcBool + FcDirCacheMapHelper (FcConfig *config, int fd, struct stat *fd_stat, struct stat *dir_stat, struct timeval *latest_cache_mtime, void *closure) + { + FcCache *cache = FcDirCacheMapFd (config, fd, fd_stat, dir_stat); +- struct timeval cache_mtime; ++ struct timeval cache_mtime, zero_mtime = { 0, 0}, dir_mtime; + + if (!cache) + return FcFalse; + cache_mtime.tv_sec = fd_stat->st_mtime; ++ dir_mtime.tv_sec = dir_stat->st_mtime; + #ifdef HAVE_STRUCT_STAT_ST_MTIM + cache_mtime.tv_usec = fd_stat->st_mtim.tv_nsec / 1000; ++ dir_mtime.tv_usec = dir_stat->st_mtim.tv_nsec / 1000; + #else + cache_mtime.tv_usec = 0; ++ dir_mtime.tv_usec = 0; + #endif +- if (timercmp (latest_cache_mtime, &cache_mtime, <)) ++ /* special take care of OSTree */ ++ if (!timercmp (&zero_mtime, &dir_mtime, !=)) ++ { ++ if (!timercmp (&zero_mtime, &cache_mtime, !=)) ++ { ++ if (*((FcCache **) closure)) ++ FcDirCacheUnload (*((FcCache **) closure)); ++ } ++ else if (*((FcCache **) closure) && !timercmp (&zero_mtime, latest_cache_mtime, !=)) ++ { ++ FcDirCacheUnload (cache); ++ return FcFalse; ++ } ++ else if (timercmp (latest_cache_mtime, &cache_mtime, <)) ++ { ++ if (*((FcCache **) closure)) ++ FcDirCacheUnload (*((FcCache **) closure)); ++ } ++ } ++ else if (timercmp (latest_cache_mtime, &cache_mtime, <)) + { + if (*((FcCache **) closure)) + FcDirCacheUnload (*((FcCache **) closure)); diff --git a/fontconfig.spec b/fontconfig.spec index be8cac5..2b9591f 100644 --- a/fontconfig.spec +++ b/fontconfig.spec @@ -5,7 +5,7 @@ Summary: Font configuration and customization library Name: fontconfig Version: 2.13.92 -Release: 10%{?dist} +Release: 11%{?dist} # src/ftglue.[ch] is in Public Domain # src/fccache.c contains Public Domain code # fc-case/CaseFolding.txt is in the UCD @@ -30,6 +30,7 @@ Patch8: %{name}-fix-test.patch Patch9: %{name}-fix-assertion.patch Patch10: %{name}-fix-dtd.patch Patch11: %{name}-fix-dtd-id.patch +Patch12: %{name}-0-timestamp-dir-on-sb.patch BuildRequires: libxml2-devel BuildRequires: freetype-devel >= %{freetype_version} @@ -189,6 +190,9 @@ fi %doc fontconfig-devel.txt fontconfig-devel %changelog +* Thu Apr 23 2020 Akira TAGOH - 2.13.92-11 +- deal with system caches as always latest on Silverblue. (#1750891) + * Thu Apr 02 2020 Akira TAGOH - 2.13.92-10 - Build against libxml2 instead of expat.