Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 193476 - fontconfig clobbers /etc/fonts/conf.d
Summary: fontconfig clobbers /etc/fonts/conf.d
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Fonts Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-23 03:52 UTC by Ryan Hill (RETIRED)
Modified: 2009-07-12 04:16 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
fontconfig-configsave.diff (fontconfig-configsave.diff,1.59 KB, patch)
2009-01-02 05:44 UTC, Ryan Hill (RETIRED)
Details | Diff
fontconfig-2.6.0-r2.ebuild.patch (fontconfig-2.6.0-r2.ebuild.patch,1.62 KB, patch)
2009-01-27 15:35 UTC, Peter Volkov (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Hill (RETIRED) gentoo-dev 2007-09-23 03:52:05 UTC
$ eselect fontconfig list | grep 49
  [14]  49-sansserif.conf *

$ eselect fontconfig disable 49-sansserif.conf

$ ls /etc/fonts/conf.d/ > fc-before

$ emerge -av fontconfig

$ ls /etc/fonts/conf.d/ > fc-after

$ diff -u fc-before fc-after
--- fc-before   2007-09-22 21:43:06.000000000 -0600
+++ fc-after    2007-09-22 21:44:47.000000000 -0600
@@ -4,6 +4,7 @@
 30-amt-aliases.conf
 30-urw-aliases.conf
 40-generic.conf
+49-sansserif.conf
 50-user.conf
 51-local.conf
 59-dejavu.conf

i'm not sure how to prevent this at the moment.
Comment 1 jackieku 2008-12-21 14:36:40 UTC
I've noticed this bug, shouldn't it add a USE flag for user to choose those symbolic links should be installed or not? As portage's CONFIG_PROTECT feature doesn't handle this case well.
Comment 2 jackieku 2008-12-21 14:36:55 UTC
I've noticed this bug, shouldn't it add a USE flag for user to choose those symbolic links should be installed or not? As portage's CONFIG_PROTECT feature doesn't handle this case well.
Comment 3 Ryan Hill (RETIRED) gentoo-dev 2008-12-23 07:56:12 UTC
i was thinking about handling this the same way baselayout handles init scripts (generate default links from a list if /etc/fonts/conf.d doesn't already exist), but the showstopper is that fontconfig upstream likes to rename, consoldate, and split up conf files between versions.  eg. 40-generic.conf got split into 40-nonlatin.conf and 45-latin.conf.

i was thinking if we check for broken symlinks in /etc/fonts/conf.d to catch renames/deletions and check what the upstream defaults are when we encounter new files we might be able to handle most of it.

i don't think a USE flag would be appropriate in this case because this is something the user shouldn't ever have to concern themselves with.
Comment 4 jackieku 2008-12-23 09:48:45 UTC
I agree USE flag is not a perfect solution, but it might be a simple workaround which is better than current situation. Maybe we can add a patch to fontconfig itself, make fontconfig can load a list file rather than a directory? So the list file can take the advantage of portage's configuration protect feature?
Comment 5 jackieku 2008-12-23 09:56:54 UTC
I'm sorry, I didn't think about that. We don't need to patch fontconfig. It already has this feature. For example, a file /etc/fonts/include.conf like this.

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <include ignore_missing="yes">/etc/conf.avail/10-unhinted.conf</include>
    <include ignore_missing="yes">/etc/conf.avail/40-generic.conf</include>
    .....
</fontconfig>

Than add a line in /etc/fonts/fonts.conf

<include ignore_missing="yes">/etc/fonts/include.conf</include>
Comment 6 Ryan Hill (RETIRED) gentoo-dev 2009-01-02 05:44:52 UTC
Created attachment 177064 [details, diff]
fontconfig-configsave.diff

this preserves the current state for config files that also exist in the new version, uses the defaults for new files, and gets rid of broken symlinks left over from old ones.
Comment 7 Peter Volkov (RETIRED) gentoo-dev 2009-01-27 15:35:41 UTC
Created attachment 179887 [details, diff]
fontconfig-2.6.0-r2.ebuild.patch

Ryan great solution! I thought about different but this I like more. Just two cents:
1. for file in $(ls something) is bad practice:
http://wooledge.org:8000/BashPitfalls#foriin.60ls.2A.mp3.60
2. Also cleaning dead symlinks I a bit improved. In such from it does not issues "rm: missing operand" warning.

My patch fixes this two points. I think it worth to commit this patch with next revision/version bump...
Comment 8 Ryan Hill (RETIRED) gentoo-dev 2009-07-12 04:16:20 UTC
Fixed in 2.7.0.