$ 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.
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.
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.
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?
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>
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.
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...
Fixed in 2.7.0.