[Fontconfig] [PATCH] Do not remove UUID file when a scanned directory is empty

Akira TAGOH akira at tagoh.org
Thu Oct 25 07:05:35 UTC 2018


Thanks for the patch. I'll move this process into the separate API and
call it only when running fc-cache with some option.
On Thu, Oct 18, 2018 at 1:16 PM Keith Packard <keithp at keithp.com> wrote:
>
> Because FcDirCacheDeleteUUID does not reset the modification time on
> the directory, and because FcDirCacheRead unconditionally creates the
> UUID file each time it is run, any empty directory in the cache will
> get its timestamp changed each time the cache for that directory is
> read.
>
> Instead, just leave the UUID file around as it is harmless.
>
> The alternative would be to only create the UUID file after the cache
> has been created and the directory has been discovered to be
> non-empty, but that would delay the creation of the UUID file.
>
> Signed-off-by: Keith Packard <keithp at keithp.com>
> ---
>  src/fcdir.c | 7 -------
>  1 file changed, 7 deletions(-)
>
> diff --git a/src/fcdir.c b/src/fcdir.c
> index 93f220c..bfcdf95 100644
> --- a/src/fcdir.c
> +++ b/src/fcdir.c
> @@ -421,13 +421,6 @@ FcDirCacheRead (const FcChar8 *dir, FcBool force, FcConfig *config)
>      /* Not using existing cache file, construct new cache */
>      if (!cache)
>         cache = FcDirCacheScan (dir, config);
> -    if (cache)
> -    {
> -       FcFontSet *fs = FcCacheSet (cache);
> -
> -       if (cache->dirs_count == 0 && (!fs || fs->nfont == 0))
> -           FcDirCacheDeleteUUID (dir, config);
> -    }
>
>      return cache;
>  }
> --
> 2.19.1
>
> _______________________________________________
> Fontconfig mailing list
> Fontconfig at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/fontconfig



-- 
Akira TAGOH


More information about the Fontconfig mailing list