Bug 249646 - fc-cache does not cache newly installed fonts if /usr/share/fonts has newer modtime
Summary: fc-cache does not cache newly installed fonts if /usr/share/fonts has newer m...
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: fontconfig
Version: 5.0
Hardware: All
OS: Linux
low
low
Target Milestone: ---
: ---
Assignee: Behdad Esfahbod
QA Contact: desktop-bugs@redhat.com
URL:
Whiteboard:
: 223178 (view as bug list)
Depends On: 226974 249644
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-07-26 01:10 UTC by Caius Chance
Modified: 2013-04-12 19:16 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-04-20 06:32:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
rpm upgrade log (15.28 KB, text/plain)
2007-08-08 06:23 UTC, Qian Cai
no flags Details
store directory's mtime in cache file (10.37 KB, patch)
2007-11-01 03:43 UTC, Peng Huang
no flags Details | Diff
Add sparc64 architecture string. (1.02 KB, patch)
2007-11-01 04:56 UTC, Peng Huang
no flags Details | Diff

Description Caius Chance 2007-07-26 01:10:39 UTC
+++ This bug was initially created as a clone of Bug #249644 +++

Description of problem:
fc-cache is not always caching newly installed fonts in fonts-chinese.

Version-Release number of selected component (if applicable):
fonts-chinese-3.03-4

How reproducible:
Sometimes.

Steps to Reproduce:
1.Fresh install RHEL 5 without Chinese support.
2.Install fonts-chinese: rpm -ivvh fonts-chinese*.rpm > rpm_inst_log
3.fc-list | sort > fc-list_out
  
Actual results:
- rpm_inst_log shows fc-cache had been run.
- fc-list_out doesn't show all installed fonts: ShanHeiSun, ZenKai.

Expected results:
- rpm_inst_log shows fc-cache had been run.
- fc-list_out shows all installed fonts: ShanHeiSun, ZenKai.

Additional info:

Comment 1 Yu Shao 2007-07-26 05:07:47 UTC
Cai Qian,

Please let us know how did you meet the problem.


Comment 2 Qian Cai 2007-07-26 05:33:21 UTC
Well, I have done a fresh install of RHEL 5 without Chinese support, then I have
figured out that I need to install fonts-chinese package to browser Chinese
website in GNOME. Therefore, I have mounted mohe:/data, and installed
RHEL5-Client-20070208.0/tree-i386/Client/fonts-chinese-3.02-9.6.el5.noarch.rpm.
Unfortunately, even after rebooted the machine, fc-list did not show any Chinese
fonts been registered. To fix my problem, I have to run "fc-cache -fr" manually
within chinese font directory.

Comment 3 Caius Chance 2007-07-26 06:17:40 UTC
Hi Cai Qian, could you please kindly test it again using:
http://porkchop.devel.redhat.com/brewroot/packages/fonts-chinese/3.02/9.9.el5/noarch/fonts-chinese-3.02-9.9.el5.noarch.rpm
Cheers, Caius.

Comment 4 Qian Cai 2007-07-26 06:27:30 UTC
It looks like have fixed the problem. I have verified it by removing
fonts-chinese, and run "fc-cache -f". Then, fc-list did not show any Chinese
fonts anymore. After installed the new package, fc-list shows them immediately.

Comment 5 Caius Chance 2007-08-03 00:51:01 UTC
Hi Cai, would you be possible to check how reproducible is the bug? Does it
happen ONLY from fresh installed RHEL5, or it may also happens sometimes along
series of 'installation and removal' steps? - Cheers, Caius.

Comment 6 Qian Cai 2007-08-03 03:38:06 UTC
After some further experiments, both 3.02-9.6.el5 and 3.02-9.9.el5 work
following instructions in comment #4. Therefore, the bug does probably only
happen from fresh installed RHEL5. I'll try to reproduce soon if I have had a
chance.

Comment 7 Caius Chance 2007-08-03 04:19:33 UTC
I might go test with fresh installed RHEL5 with VM.

Comment 8 Qian Cai 2007-08-08 06:22:32 UTC
I finally have had to change to test it today. I have tried both fonts-chinese
versions after fresh installation, fc-list does not show any chinese fonts.
After run "fc-cache -f" manually, fonts correctly show in the list. Please see
attachment for the log during package installation.

Comment 9 Qian Cai 2007-08-08 06:23:37 UTC
Created attachment 160882 [details]
rpm upgrade log

Comment 10 Peng Huang 2007-08-14 05:04:23 UTC
I have analyzed a similar bug. It is because of changing of system-time. please
refer to bug 223178 .

Comment 11 Caius Chance 2007-08-17 04:27:49 UTC
test case:

1. Fresh installed system, i.e. f8.
2. Set the clock at pasted time: `system-config-time`.
3. Install fonts-chinese: `rpm -i fonts-chinese-3.03-13.fc8.noarch.rpm`.
4. Check: `fc-list | grep uming`.

Comment 12 Caius Chance 2007-08-17 05:42:14 UTC
Bug is reproduced followed comment# 11. 

Comment 13 Jens Petersen 2007-08-17 08:10:18 UTC
So probably it helps to give the path of the actual font directory to fc-cache
rather than the generic /usr/share/fonts.

Comment 14 Peng Huang 2007-08-20 02:11:57 UTC
I suppose that fc-cache should give a return value to indicate the update
status, and then we could check it in rpm script. If we found no folders are
updated, we should use -f argument to run it again.


Comment 15 Jens Petersen 2007-08-20 02:36:05 UTC
At least fc-cache on the newly installed font directories should not fail
since the timestamp will not be affected by clock-skew.

Comment 16 Peng Huang 2007-08-20 02:57:00 UTC
But it will not update the cache file for /usr/share/fonts. This cache file
stores how many and which subfolders in /usr/share/fonts. If this cache is
outdated, I think it would cause some problems.

Comment 17 Peng Huang 2007-08-21 03:08:31 UTC
I thought out a simple way to fix this problem.
step 1: run fc-cache
step 2: use fc-cat /usr/share/fonts/chinese to check whether the cache have been
created properly.
step 3: if not, run fc-cache -f to recreate all cache files.




Comment 18 Akira TAGOH 2007-08-22 07:42:58 UTC
(In reply to comment #17)
> I thought out a simple way to fix this problem.
> step 1: run fc-cache
> step 2: use fc-cat /usr/share/fonts/chinese to check whether the cache have been
> created properly.
> step 3: if not, run fc-cache -f to recreate all cache files.

The actual work under fc-cache is not that simple as the above step. if that's
the case, just fc-cache -f would be much simpler. I'd like to have a solution
not to run fc-cache with -f, though.

However it's probably impossible without a fix of fontconfig IMHO. we may want
to think about more how fontconfig helps us in this case.

Comment 19 Jens Petersen 2007-09-05 01:39:20 UTC
This is not really a fonts-chinese specific bug at all so reassigning
to fontconfig for comments.

Comment 20 Akira TAGOH 2007-09-05 02:00:31 UTC
*** Bug 223178 has been marked as a duplicate of this bug. ***

Comment 21 Peng Huang 2007-09-05 02:25:15 UTC
How about we store fontdirs' timestamps in cache files and consider a cache is
invalidate when fontdir's timestamps is not equal to stored timestamps in cache?
I think even if the system is incorrect, it is impossible that fontdir's
timestamps are not changed when the directory is being changed.

Comment 25 Behdad Esfahbod 2007-10-24 04:04:25 UTC
If you have any suggestions, I appreciate it if you bring it up on the
fontconfig mailing list.  I agree that it can be improved, but don't see it as a
high-prio bug.

Alternatively, we can use fc-cache -f unconditionally in all font packages, but
that's not optimal.

Comment 27 Peng Huang 2007-11-01 03:43:04 UTC
Created attachment 245101 [details]
store directory's mtime in cache file

This problem has been fixed in upstream. I get this patch from upstream's
source repository. But It is base on 2.4.2. We should update our version from
2.4.1 to 2.4.2.

Comment 28 Peng Huang 2007-11-01 04:56:20 UTC
Created attachment 245121 [details]
Add sparc64 architecture string.

If we want to patch store_mtime_in_cache.patch on 2.4.1, we must patch this
patch at first. It can resolve a conflict in fc-arch/fcarch.tmpl.h .

Comment 30 RHEL Program Management 2007-12-03 20:44:38 UTC
This request was evaluated by Red Hat Product Management for
inclusion, but this component is not scheduled to be updated in
the current Red Hat Enterprise Linux release.  This request will
be reviewed for a future Red Hat Enterprise Linux release.

Comment 37 Jens Petersen 2010-04-20 06:32:08 UTC
I dunno if this would require a version rebase -
anyway looks pretty unlikely to me.

Closing given that it is an internally reported bug


Note You need to log in before you can comment on or make changes to this bug.