Bug 1021757 - Use fc-cache /usr/share/fonts/<your font directory> instead of /usr/share/fonts
Use fc-cache /usr/share/fonts/<your font directory> instead of /usr/share/fonts
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: ghostscript-fonts (Show other bugs)
19
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Tim Waugh
Fedora Extras Quality Assurance
:
Depends On:
Blocks: 1023977
  Show dependency treegraph
 
Reported: 2013-10-21 22:25 EDT by Akira TAGOH
Modified: 2013-11-10 02:05 EST (History)
3 users (show)

See Also:
Fixed In Version: ghostscript-fonts-5.50-32.fc20
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1023977 (view as bug list)
Environment:
Last Closed: 2013-11-07 23:40:04 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Akira TAGOH 2013-10-21 22:25:37 EDT
Description of problem:
Running fc-cache with /usr/share/fonts takes too much time and may breaks the cache for parents when installing multiple font packages or upgrading fontconfig, especially sometimes happens on the installation say.
As the macro in fontpackages does, please follow it up and use fc-cache /usr/share/fonts/<your font directory> instead of /usr/share/fonts.

Version-Release number of selected component (if applicable):
ghostscript-fonts-5.50-30.fc19.noarch

How reproducible:
always

Steps to Reproduce:
1.rpm -q --scripts ghostscript-fonts-5.50-30.fc19.noarch
2.
3.

Actual results:
postinstall scriptlet (using /bin/sh):
{
   mkfontscale /usr/share/fonts/default/ghostscript
   mkfontdir /usr/share/fonts/default/ghostscript
   fc-cache /usr/share/fonts
} &> /dev/null || :
postuninstall scriptlet (using /bin/sh):
{
   if [ "$1" = "0" ]; then
      fc-cache /usr/share/fonts
   fi
} &> /dev/null || :

Expected results:
the directory should be /usr/share/fonts/<your font directory> instead

Additional info:
Comment 1 Tim Waugh 2013-10-22 04:51:41 EDT
For the postuninstall scriptlet too?

Is there anything planned for the Fedora Project packaging guidelines to make sure there are no regressions with this?

Does this change look correct?:

diff --git a/ghostscript-fonts.spec b/ghostscript-fonts.spec
index d66fbaa..c2cbc3f 100644
--- a/ghostscript-fonts.spec
+++ b/ghostscript-fonts.spec
@@ -1,7 +1,7 @@
 Summary: Fonts for the Ghostscript PostScript interpreter
 Name: ghostscript-fonts
 Version: 5.50
-Release: 30%{?dist}
+Release: 31%{?dist}
 # Contacted Kevin Hartig, who agreed to relicense his fonts under the SIL Open Font 
 # License. Hershey fonts are under the "Hershey Font License", which is not what Fontmap 
 # says (Fontmap is wrong).
@@ -58,13 +58,13 @@ ln -sf %{fontdir} $RPM_BUILD_ROOT%{catalogue}/default-ghostscript
 {
    mkfontscale %{fontdir}
    mkfontdir %{fontdir}
-   fc-cache %{_datadir}/fonts
+   fc-cache %{fontdir}
 } &> /dev/null || :
 
 %postun
 {
    if [ "$1" = "0" ]; then
-      fc-cache %{_datadir}/fonts
+      fc-cache %{fontdir}
    fi
 } &> /dev/null || :
 
@@ -80,6 +80,10 @@ rm -rf $RPM_BUILD_ROOT
 %ghost %verify(not md5 size mtime) %{fontdir}/fonts.scale
 
 %changelog
+* Tue Oct 22 2013 Tim Waugh <twaugh@redhat.com> - 5.50-31
+- Run fc-cache on our font directory, not the entire font collection
+  (bug #1021757).
+
 * Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.50-30
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
Comment 2 Nicolas Mailhot 2013-10-22 05:23:13 EDT
(In reply to Tim Waugh from comment #1)
> For the postuninstall scriptlet too?
> 
> Is there anything planned for the Fedora Project packaging guidelines to
> make sure there are no regressions with this?

Well, what the packaging guidelines actually say is that you shouldn't install any font without using fontpackages-devel templates and macros or splitting fonts per family, which means all font packages have the same implementation and there is no risk of single-package regression.

I appreciate that ghostscript antedates the consolidation work that went into current font packaging guidelines, but maybe it's time to align it with them?

Also TEX people have spent many years cleaning up and modernizing gs fonts. It would be worthwhile to package the tex gyre family and use them as replacement, dropping all legacy font formats and core font calls. I *think* tex gyre licensing is finally clean and safe (but you'd need to check with spot)
Comment 3 Tim Waugh 2013-10-22 06:15:13 EDT
That's a fair point. :-)

That work might have to be done in step with urw-fonts.
Comment 4 Fedora Update System 2013-10-22 06:27:51 EDT
ghostscript-fonts-5.50-32.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/ghostscript-fonts-5.50-32.fc19
Comment 5 Fedora Update System 2013-10-22 06:28:34 EDT
ghostscript-fonts-5.50-32.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/ghostscript-fonts-5.50-32.fc20
Comment 6 Fedora Update System 2013-10-22 14:51:18 EDT
Package ghostscript-fonts-5.50-32.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing ghostscript-fonts-5.50-32.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-19682/ghostscript-fonts-5.50-32.fc20
then log in and leave karma (feedback).
Comment 7 Fedora Update System 2013-11-07 23:40:04 EST
ghostscript-fonts-5.50-32.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 8 Fedora Update System 2013-11-10 02:05:08 EST
ghostscript-fonts-5.50-32.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

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