/[gentoo-x86]/eclass/font.eclass
Gentoo

Diff of /eclass/font.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.30 Revision 1.31
1# Copyright 1999-2007 Gentoo Foundation 1# Copyright 1999-2007 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/font.eclass,v 1.30 2007/09/16 06:21:05 dirtyepic Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/font.eclass,v 1.31 2007/09/16 07:07:52 dirtyepic Exp $
4 4
5# Author: foser <foser@gentoo.org> 5# Author: foser <foser@gentoo.org>
6 6
7# Font Eclass 7# Font Eclass
8# 8#
106 # setup is not the nicest place, but preinst doesn't cut it 106 # setup is not the nicest place, but preinst doesn't cut it
107 [[ -e "${FONTDIR}/fonts.cache-1" ]] && rm -f "${FONTDIR}/fonts.cache-1" 107 [[ -e "${FONTDIR}/fonts.cache-1" ]] && rm -f "${FONTDIR}/fonts.cache-1"
108} 108}
109 109
110font_pkg_postinst() { 110font_pkg_postinst() {
111 # unreadable font files = fontconfig segfaults
111 find /usr/share/fonts/ -type f \! -perm 0644 -print0 \ 112 badperms="$( find /usr/share/fonts/ -type f \! -perm 0644 -print )"
112 | xargs -0 chmod 0644 2&>/dev/null 113 if [[ -n ${badperms} ]]; then
114 echo
115 for fontfile in ${badperms}; do
116 ewarn $( chmod -v 0644 ${fontfile} )
117 done
118 echo
119 fi
113 120
114 if has_version '>=media-libs/fontconfig-2.4'; then 121 if has_version '>=media-libs/fontconfig-2.4'; then
115 if [ ${ROOT} == "/" ]; then 122 if [ ${ROOT} == "/" ]; then
116 ebegin "Updating global fontcache" 123 ebegin "Updating global fontcache"
117 fc-cache -fs 124 fc-cache -fs
119 fi 126 fi
120 fi 127 fi
121} 128}
122 129
123font_pkg_postrm() { 130font_pkg_postrm() {
131 # unreadable font files = fontconfig segfaults
124 find /usr/share/fonts/ -type f \! -perm 0644 -print0 \ 132 badperms="$( find /usr/share/fonts/ -type f \! -perm 0644 -print )"
125 | xargs -0 chmod 0644 2&>/dev/null 133 if [[ -n ${badperms} ]]; then
134 echo
135 for fontfile in ${badperms}; do
136 ewarn $( chmod -v 0644 ${fontfile} )
137 done
138 echo
139 fi
126 140
127 if has_version '>=media-libs/fontconfig-2.4'; then 141 if has_version '>=media-libs/fontconfig-2.4'; then
128 if [ ${ROOT} == "/" ]; then 142 if [ ${ROOT} == "/" ]; then
129 ebegin "Updating global fontcache" 143 ebegin "Updating global fontcache"
130 fc-cache -fs 144 fc-cache -fs

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.31

  ViewVC Help
Powered by ViewVC 1.1.20