[Fontconfig] patch: crosscheck font caches

John Ellson ellson at research.att.com
Tue Nov 1 03:06:29 EST 2005


Patrick Lam wrote:
> I can't reproduce the broken-cache problem on my computer, although I
> can verify that the broken caches that other people send me are indeed
> broken.  I don't know when this corruption is occuring; note that it
> also throws out all the strings and langsets in the cache file.  This
> patch adds an assertion that will abort fc-cache when it's trying to
> write a corrupted cache file.  If some of the people experiencing
> corrupted caches could try this patch and tell me under what
> circumstances corruption is happening, that would help a lot, because
> I'm somewhat at a loss.
>
> Is there any chance that some other application (not fc-cache) is
> modifying the fonts.cache-2 file?  That would be weird and inexplicable.
>  Mail me if you have any ideas.
>
> pat
>   
What about this code in the .spec file of dejavu-fonts-1.15-2 ?
I can't positively blame this package, but my font problems seemed to 
start about the time I installed it.

======from dejavu-fonts.spec============================================
%install
/bin/rm -rf %{buildroot}

#fonts
install -d -m 0755 %{buildroot}%{fontdir}
install -m 0644 *.ttf  %{buildroot}%{fontdir}

# "touch" all files we've got flagged as %ghost  but which are not
# present in the RPM_BUILD_ROOT when RPM looks for files
/bin/touch %{buildroot}%{fontdir}/fonts.cache-1
/bin/touch %{buildroot}%{fontdir}/fonts.cache-2

%clean
/bin/rm -rf %{buildroot}


%post
if [ -x %{_bindir}/fc-cache ]; then
  %{_bindir}/fc-cache %{_datadir}/fonts
fi

%postun
if [ "$1" = "0" ]; then
  if [ -x %{_bindir}/fc-cache ]; then
    %{_bindir}/fc-cache %{_datadir}/fonts
  fi
fi
=====================================================

John



More information about the Fontconfig mailing list