--- /usr/portage/media-libs/fontconfig/fontconfig-2.6.0-r2.ebuild 2008-12-07 06:08:37.000000000 -0600 +++ /usr/portage/media-libs/fontconfig/fontconfig-2.6.0-r2.ebuild 2009-01-01 23:43:50.000000000 -0600 @@ -101,14 +101,42 @@ doenvd "${T}"/37fontconfig } +pkg_preinst() { + # Bug #193476 + # /etc/fonts/conf.d/ contains symlinks to ../conf.avail/ to include various + # config files. If we install as-is, we'll blow away user settings. + + local f + + ebegin "Syncing configuration to system" + if [[ -e ${ROOT}/etc/fonts/conf.d ]]; then + for f in $(ls "${ROOT}"/etc/fonts/conf.avail/); do + if [[ -L ${ROOT}/etc/fonts/conf.d/${f} ]]; then + [[ -f ${D}etc/fonts/conf.avail/${f} ]] \ + && ln -sf ../conf.avail/"${f}" "${D}"etc/fonts/conf.d/ &>/dev/null + else + [[ -f ${D}etc/fonts/conf.avail/${f} ]] \ + && rm "${D}"etc/fonts/conf.d/"${f}" &>/dev/null + fi + done + fi + eend $? +} + pkg_postinst() { + # clean up broken symlinks + find -L "${ROOT}"etc/fonts/conf.d/ -lname "*" -print0 | xargs -0 rm + echo - ewarn "Please make fontconfig configuration changes in /etc/fonts/conf.d/" - ewarn "and NOT to /etc/fonts/fonts.conf, as it will be replaced!" + ewarn "Please make fontconfig configuration changes using \`eselect fontconfig\`" + ewarn "Any changes made to /etc/fonts/fonts.conf will be overwritten." + ewarn + ewarn "If you need to reset your configuration to upstream defaults, delete" + ewarn "the directory ${ROOT}etc/fonts/conf.d/ and re-emerge fontconfig." echo if [[ ${ROOT} = / ]]; then - ebegin "Creating global font cache..." + ebegin "Creating global font cache" /usr/bin/fc-cache -sr eend $? fi