[Fontconfig] Re: Patch: fix for fc-cache with relative path
Mike FABIAN
mfabian at suse.de
Wed Jan 11 08:41:06 PST 2006
Patrick Lam <plam at MIT.EDU> さんは書きました:
> Frederic Crozat wrote:
>> Hi,
>>
>> the new cache location code has introduced new bugs in fontconfig :
>> -when using fc-cache . in a directory, the string used to generate
>> md5sum key is always "./fonts.cache-2" which will collide if the same
>> command is run in several directories.
Looks like this problem is *not* fixed yet (CVS checkout from today):
mfabian at magellan:/usr/X11R6/lib/X11/fonts/truetype$ sudo time fc-cache -v .
fc-cache: ".": caching, 919 fonts, 0 dirs
fc-cache: succeeded
35.78user 1.12system 2:06.67elapsed 29%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (18668major+233607minor)pagefaults 0swaps
mfabian at magellan:/usr/X11R6/lib/X11/fonts/truetype$ ls /var/cache/fontconfig/
d6867d8c7d183335b46263581b96fdc1.cache-2 stamp
mfabian at magellan:/usr/X11R6/lib/X11/fonts/truetype$
one cache file has been created. Try again:
mfabian at magellan:/usr/X11R6/lib/X11/fonts/truetype$ sudo time fc-cache -v .
fc-cache: ".": skipping, 919 fonts, 0 dirs
fc-cache: succeeded
0.00user 0.00system 0:02.21elapsed 0%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (6major+341minor)pagefaults 0swaps
mfabian at magellan:/usr/X11R6/lib/X11/fonts/truetype$
OK, skipped now, cache is up to date.
Try to generate a cache for a different directory:
mfabian at magellan:/usr/X11R6/lib/X11/fonts$ cd ../Type1/
mfabian at magellan:/usr/X11R6/lib/X11/fonts/Type1$ sudo time fc-cache -v .
fc-cache: ".": skipping, 919 fonts, 0 dirs
fc-cache: succeeded
0.00user 0.00system 0:02.02elapsed 0%CPU (0avgtext+0avgdata
0maxresident)k
0inputs+0outputs (0major+348minor)pagefaults 0swaps
mfabian at magellan:/usr/X11R6/lib/X11/fonts/Type1$
Surprisingly skipped, although no cache for this directory
exists (neither in /var/cache/fontconfig nor in
/usr/X11R6/lib/X11/fonts/Type1).
No new cache file has been generated:
mfabian at magellan:/usr/X11R6/lib/X11/fonts/Type1$ ls /var/cache/fontconfig/
d6867d8c7d183335b46263581b96fdc1.cache-2 stamp
mfabian at magellan:/usr/X11R6/lib/X11/fonts/Type1$
>> -a similar problem happen when using : fc-cache /foo/bar and
>> fc-cache /foo/bar/ : strings used to generate md5sum are not the same,
>> resulting in different cache.
>>
>> The attached patch fixes the issue.
>
> I've committed my patch.
Hmm, that problem seems to persist as well:
mfabian at magellan:/usr/X11R6/lib/X11/fonts/Type1$ sudo time fc-cache -v /usr/X11R6/lib/X11/fonts/Type1
fc-cache: "/usr/X11R6/lib/X11/fonts/Type1": caching, 59 fonts, 0 dirs
fc-cache: succeeded
0.30user 0.02system 0:02.81elapsed 11%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (198major+1357minor)pagefaults 0swaps
mfabian at magellan:/usr/X11R6/lib/X11/fonts/Type1$
One new cache file has been generated:
mfabian at magellan:/usr/X11R6/lib/X11/fonts/Type1$ ls /var/cache/fontconfig/
57fddf4aeff95a0b98650bf3f13c26fe.cache-2 stamp
d6867d8c7d183335b46263581b96fdc1.cache-2
mfabian at magellan:/usr/X11R6/lib/X11/fonts/Type1$
Try again adding a '/' at the end of the path:
mfabian at magellan:/usr/X11R6/lib/X11/fonts/Type1$ sudo time fc-cache -v /usr/X11R6/lib/X11/fonts/Type1/
fc-cache: "/usr/X11R6/lib/X11/fonts/Type1/": caching, 59 fonts, 0 dirs
fc-cache: succeeded
0.28user 0.01system 0:02.31elapsed 12%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+1550minor)pagefaults 0swaps
mfabian at magellan:/usr/X11R6/lib/X11/fonts/Type1$
A new cache has been generated:
mfabian at magellan:/usr/X11R6/lib/X11/fonts/Type1$ ls /var/cache/fontconfig/
57fddf4aeff95a0b98650bf3f13c26fe.cache-2
d6867d8c7d183335b46263581b96fdc1.cache-2
b2b474fcfbd349e17fee496b6c581dbd.cache-2 stamp
mfabian at magellan:/usr/X11R6/lib/X11/fonts/Type1$
--
Mike FABIAN <mfabian at suse.de> http://www.suse.de/~mfabian
睡眠不足はいい仕事の敵だ。
More information about the Fontconfig
mailing list