1 |
* Add inherit guard like all modern eclasses |
2 |
|
3 |
Closes: https://bugs.gentoo.org/679658 |
4 |
Signed-off-by: David Seifert <soap@g.o> |
5 |
--- |
6 |
eclass/font.eclass | 43 +++++++++++++++---------------------------- |
7 |
1 file changed, 15 insertions(+), 28 deletions(-) |
8 |
|
9 |
diff --git a/eclass/font.eclass b/eclass/font.eclass |
10 |
index 76c20549ea6..cdf3494a79c 100644 |
11 |
--- a/eclass/font.eclass |
12 |
+++ b/eclass/font.eclass |
13 |
@@ -4,15 +4,17 @@ |
14 |
# @ECLASS: font.eclass |
15 |
# @MAINTAINER: |
16 |
# fonts@g.o |
17 |
-# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7 |
18 |
+# @SUPPORTED_EAPIS: 5 6 7 |
19 |
# @BLURB: Eclass to make font installation uniform |
20 |
|
21 |
case ${EAPI:-0} in |
22 |
- 0|1|2|3|4|5|6) inherit eutils ;; |
23 |
+ [56]) inherit eutils ;; |
24 |
7) ;; |
25 |
*) die "EAPI ${EAPI} is not supported by font.eclass." ;; |
26 |
esac |
27 |
|
28 |
+if [[ ! ${_FONT_ECLASS} ]]; then |
29 |
+ |
30 |
EXPORT_FUNCTIONS pkg_setup src_install pkg_postinst pkg_postrm |
31 |
|
32 |
# @ECLASS-VARIABLE: FONT_SUFFIX |
33 |
@@ -76,9 +78,7 @@ font_xfont_config() { |
34 |
-e ${EPREFIX}/usr/share/fonts/encodings \ |
35 |
-e ${EPREFIX}/usr/share/fonts/encodings/large \ |
36 |
"${ED%/}/${FONTDIR}/${1//${S}/}" || eerror "failed to create fonts.dir" |
37 |
- if [[ -e fonts.alias ]]; then |
38 |
- doins fonts.alias || die "failed to install fonts.alias" # TODO old EAPI cleanup |
39 |
- fi |
40 |
+ [[ -e fonts.alias ]] && doins fonts.alias |
41 |
fi |
42 |
} |
43 |
|
44 |
@@ -90,9 +90,7 @@ font_fontconfig() { |
45 |
if [[ -n ${FONT_CONF[@]} ]]; then |
46 |
insinto /etc/fonts/conf.avail/ |
47 |
for conffile in "${FONT_CONF[@]}"; do |
48 |
- if [[ -e ${conffile} ]]; then |
49 |
- doins ${conffile} || die "failed to install conf file" # TODO old EAPI cleanup |
50 |
- fi |
51 |
+ [[ -e ${conffile} ]] && doins "${conffile}" |
52 |
done |
53 |
fi |
54 |
} |
55 |
@@ -146,20 +144,8 @@ font_cleanup_dirs() { |
56 |
# @FUNCTION: font_pkg_setup |
57 |
# @DESCRIPTION: |
58 |
# The font pkg_setup function. |
59 |
-# Collision protection and Prefix compat for eapi < 3. |
60 |
+# Collision protection |
61 |
font_pkg_setup() { |
62 |
- # Prefix compat |
63 |
- case ${EAPI:-0} in |
64 |
- 0|1|2) |
65 |
- if ! use prefix; then |
66 |
- EPREFIX= |
67 |
- ED=${D} |
68 |
- EROOT=${ROOT} |
69 |
- [[ ${EROOT} = */ ]] || EROOT+="/" |
70 |
- fi |
71 |
- ;; |
72 |
- esac |
73 |
- |
74 |
# make sure we get no collisions |
75 |
# setup is not the nicest place, but preinst doesn't cut it |
76 |
if [[ -e "${EROOT%/}/${FONTDIR}/fonts.cache-1" ]] ; then |
77 |
@@ -181,7 +167,7 @@ font_src_install() { |
78 |
pushd "${dir}" > /dev/null |
79 |
insinto "${FONTDIR}/${dir//${S}/}" |
80 |
for suffix in ${FONT_SUFFIX}; do |
81 |
- doins *.${suffix} || die "font installation failed" # TODO old EAPI cleanup |
82 |
+ doins *.${suffix} |
83 |
done |
84 |
font_xfont_config "${dir}" |
85 |
popd > /dev/null |
86 |
@@ -190,7 +176,7 @@ font_src_install() { |
87 |
pushd "${FONT_S}" > /dev/null |
88 |
insinto "${FONTDIR}" |
89 |
for suffix in ${FONT_SUFFIX}; do |
90 |
- doins *.${suffix} || die "font installation failed" # TODO old EAPI cleanup |
91 |
+ doins *.${suffix} |
92 |
done |
93 |
font_xfont_config |
94 |
popd > /dev/null |
95 |
@@ -198,10 +184,10 @@ font_src_install() { |
96 |
|
97 |
font_fontconfig |
98 |
|
99 |
- [[ -n ${DOCS} ]] && { dodoc ${DOCS} || die "docs installation failed" ; } # TODO old EAPI cleanup |
100 |
+ einstalldocs |
101 |
|
102 |
# install common docs |
103 |
- for commondoc in COPYRIGHT README{,.md,.txt} NEWS AUTHORS BUGS ChangeLog FONTLOG.txt; do |
104 |
+ for commondoc in COPYRIGHT FONTLOG.txt; do |
105 |
[[ -s ${commondoc} ]] && dodoc ${commondoc} |
106 |
done |
107 |
} |
108 |
@@ -238,9 +224,7 @@ font_pkg_postinst() { |
109 |
elog "The following fontconfig configuration files have been installed:" |
110 |
elog |
111 |
for conffile in "${FONT_CONF[@]}"; do |
112 |
- if [[ -e "${EROOT%/}"/etc/fonts/conf.avail/${conffile##*/} ]]; then |
113 |
- elog " ${conffile##*/}" |
114 |
- fi |
115 |
+ [[ -e "${EROOT%/}"/etc/fonts/conf.avail/${conffile##*/} ]] && elog " ${conffile##*/}" |
116 |
done |
117 |
elog |
118 |
elog "Use \`eselect fontconfig\` to enable/disable them." |
119 |
@@ -256,3 +240,6 @@ font_pkg_postrm() { |
120 |
font_cleanup_dirs |
121 |
_update_fontcache |
122 |
} |
123 |
+ |
124 |
+_FONT_ECLASS=1 |
125 |
+fi |
126 |
-- |
127 |
2.23.0 |