Gentoo Archives: gentoo-commits

From: "Ryan Hill (dirtyepic)" <dirtyepic@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: font.eclass
Date: Sat, 15 May 2010 05:25:39
Message-Id: 20100515052532.CE0052C5F1@corvid.gentoo.org
1 dirtyepic 10/05/15 05:25:32
2
3 Modified: font.eclass
4 Log:
5 Improve documentation.
6
7 Revision Changes Path
8 1.50 eclass/font.eclass
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/font.eclass?rev=1.50&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/font.eclass?rev=1.50&content-type=text/plain
12 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/font.eclass?r1=1.49&r2=1.50
13
14 Index: font.eclass
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/font.eclass,v
17 retrieving revision 1.49
18 retrieving revision 1.50
19 diff -u -r1.49 -r1.50
20 --- font.eclass 20 Apr 2010 04:06:59 -0000 1.49
21 +++ font.eclass 15 May 2010 05:25:32 -0000 1.50
22 @@ -1,13 +1,10 @@
23 # Copyright 1999-2010 Gentoo Foundation
24 # Distributed under the terms of the GNU General Public License v2
25 -# $Header: /var/cvsroot/gentoo-x86/eclass/font.eclass,v 1.49 2010/04/20 04:06:59 dirtyepic Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/font.eclass,v 1.50 2010/05/15 05:25:32 dirtyepic Exp $
27
28 # @ECLASS: font.eclass
29 # @MAINTAINER:
30 -# fonts@g.o
31 -
32 -# Author: Tomáš Chvátal <scarabeus@g.o>
33 -# Author: foser <foser@g.o>
34 +# fonts@g.o
35 # @BLURB: Eclass to make font installation uniform
36
37 inherit eutils
38 @@ -16,32 +13,32 @@
39
40 # @ECLASS-VARIABLE: FONT_SUFFIX
41 # @DESCRIPTION:
42 -# Space delimited list of font suffixes to install
43 +# Space delimited list of font suffixes to install.
44 FONT_SUFFIX=${FONT_SUFFIX:=}
45
46 # @ECLASS-VARIABLE: FONT_S
47 # @DESCRIPTION:
48 -# Dir containing the fonts
49 +# Working directory containing the fonts.
50 FONT_S=${FONT_S:=${S}}
51
52 # @ECLASS-VARIABLE: FONT_PN
53 # @DESCRIPTION:
54 -# Last part of $FONTDIR
55 +# Font name (ie. last part of FONTDIR).
56 FONT_PN=${FONT_PN:=${PN}}
57
58 # @ECLASS-VARIABLE: FONTDIR
59 # @DESCRIPTION:
60 -# This is where the fonts are installed
61 +# Full path to installation directory.
62 FONTDIR=${FONTDIR:-/usr/share/fonts/${FONT_PN}}
63
64 # @ECLASS-VARIABLE: FONT_CONF
65 # @DESCRIPTION:
66 -# Array, which element(s) is(are) path(s) of fontconfig-2.4 file(s) to install
67 +# Array containing fontconfig conf files to install.
68 FONT_CONF=( "" )
69
70 # @ECLASS-VARIABLE: DOCS
71 # @DESCRIPTION:
72 -# Docs to install
73 +# Space delimited list of docs to install.
74 DOCS=${DOCS:-}
75
76 IUSE="X"
77 @@ -54,9 +51,8 @@
78
79 # @FUNCTION: font_xfont_config
80 # @DESCRIPTION:
81 -# Creates the Xfont files.
82 +# Generate Xorg font files (mkfontscale/mkfontdir).
83 font_xfont_config() {
84 - # create Xfont files
85 if has X ${IUSE//+} && use X ; then
86 ebegin "Creating fonts.scale & fonts.dir"
87 rm -f "${ED}${FONTDIR}"/fonts.{dir,scale}
88 @@ -66,15 +62,15 @@
89 -e ${EPREFIX}/usr/share/fonts/encodings/large \
90 "${ED}${FONTDIR}"
91 eend $?
92 - if [ -e "${FONT_S}/fonts.alias" ] ; then
93 - doins "${FONT_S}/fonts.alias"
94 + if [[ -e ${FONT_S}/fonts.alias ]] ; then
95 + doins "${FONT_S}"/fonts.alias
96 fi
97 fi
98 }
99
100 # @FUNCTION: font_fontconfig
101 # @DESCRIPTION:
102 -# Installs the fontconfig config files of FONT_CONF.
103 +# Install fontconfig conf files given in FONT_CONF.
104 font_fontconfig() {
105 local conffile
106 if [[ -n ${FONT_CONF[@]} ]]; then
107 @@ -87,8 +83,7 @@
108
109 # @FUNCTION: font_cleanup_dirs
110 # @DESCRIPTION:
111 -# Remove any font directories only containing generated files.
112 -# Runs in pkg_postrm.
113 +# Remove font directories containing only generated files.
114 font_cleanup_dirs() {
115 local genfiles="encodings.dir fonts.alias fonts.cache-1 fonts.dir fonts.scale"
116 local d f g generated candidate otherfile
117 @@ -150,7 +145,7 @@
118 # @FUNCTION: font_pkg_setup
119 # @DESCRIPTION:
120 # The font pkg_setup function.
121 -# Collision portection and Prefix compat for eapi < 3.
122 +# Collision protection and Prefix compat for eapi < 3.
123 font_pkg_setup() {
124 # Prefix compat
125 case ${EAPI:-0} in
126 @@ -172,7 +167,6 @@
127 # @FUNCTION: font_pkg_postinst
128 # @DESCRIPTION:
129 # The font pkg_postinst function.
130 -# Update global font cache and fix permissions.
131 font_pkg_postinst() {
132 # unreadable font files = fontconfig segfaults
133 find "${EROOT}"usr/share/fonts/ -type f '!' -perm 0644 -print0 \
134 @@ -203,7 +197,6 @@
135 # @FUNCTION: font_pkg_postrm
136 # @DESCRIPTION:
137 # The font pkg_postrm function.
138 -# Updates global font cache
139 font_pkg_postrm() {
140 font_cleanup_dirs