From: David Seifert <soap@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: David Seifert <soap@gentoo.org>
Subject: [gentoo-dev] [PATCH] font.eclass: Ban EAPIs < 5
Date: Sun, 20 Oct 2019 18:50:12 +0200 [thread overview]
Message-ID: <20191020165012.3498212-1-soap@gentoo.org> (raw)
* Add inherit guard like all modern eclasses
Closes: https://bugs.gentoo.org/679658
Signed-off-by: David Seifert <soap@gentoo.org>
---
eclass/font.eclass | 43 +++++++++++++++----------------------------
1 file changed, 15 insertions(+), 28 deletions(-)
diff --git a/eclass/font.eclass b/eclass/font.eclass
index 76c20549ea6..cdf3494a79c 100644
--- a/eclass/font.eclass
+++ b/eclass/font.eclass
@@ -4,15 +4,17 @@
# @ECLASS: font.eclass
# @MAINTAINER:
# fonts@gentoo.org
-# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7
+# @SUPPORTED_EAPIS: 5 6 7
# @BLURB: Eclass to make font installation uniform
case ${EAPI:-0} in
- 0|1|2|3|4|5|6) inherit eutils ;;
+ [56]) inherit eutils ;;
7) ;;
*) die "EAPI ${EAPI} is not supported by font.eclass." ;;
esac
+if [[ ! ${_FONT_ECLASS} ]]; then
+
EXPORT_FUNCTIONS pkg_setup src_install pkg_postinst pkg_postrm
# @ECLASS-VARIABLE: FONT_SUFFIX
@@ -76,9 +78,7 @@ font_xfont_config() {
-e ${EPREFIX}/usr/share/fonts/encodings \
-e ${EPREFIX}/usr/share/fonts/encodings/large \
"${ED%/}/${FONTDIR}/${1//${S}/}" || eerror "failed to create fonts.dir"
- if [[ -e fonts.alias ]]; then
- doins fonts.alias || die "failed to install fonts.alias" # TODO old EAPI cleanup
- fi
+ [[ -e fonts.alias ]] && doins fonts.alias
fi
}
@@ -90,9 +90,7 @@ font_fontconfig() {
if [[ -n ${FONT_CONF[@]} ]]; then
insinto /etc/fonts/conf.avail/
for conffile in "${FONT_CONF[@]}"; do
- if [[ -e ${conffile} ]]; then
- doins ${conffile} || die "failed to install conf file" # TODO old EAPI cleanup
- fi
+ [[ -e ${conffile} ]] && doins "${conffile}"
done
fi
}
@@ -146,20 +144,8 @@ font_cleanup_dirs() {
# @FUNCTION: font_pkg_setup
# @DESCRIPTION:
# The font pkg_setup function.
-# Collision protection and Prefix compat for eapi < 3.
+# Collision protection
font_pkg_setup() {
- # Prefix compat
- case ${EAPI:-0} in
- 0|1|2)
- if ! use prefix; then
- EPREFIX=
- ED=${D}
- EROOT=${ROOT}
- [[ ${EROOT} = */ ]] || EROOT+="/"
- fi
- ;;
- esac
-
# make sure we get no collisions
# setup is not the nicest place, but preinst doesn't cut it
if [[ -e "${EROOT%/}/${FONTDIR}/fonts.cache-1" ]] ; then
@@ -181,7 +167,7 @@ font_src_install() {
pushd "${dir}" > /dev/null
insinto "${FONTDIR}/${dir//${S}/}"
for suffix in ${FONT_SUFFIX}; do
- doins *.${suffix} || die "font installation failed" # TODO old EAPI cleanup
+ doins *.${suffix}
done
font_xfont_config "${dir}"
popd > /dev/null
@@ -190,7 +176,7 @@ font_src_install() {
pushd "${FONT_S}" > /dev/null
insinto "${FONTDIR}"
for suffix in ${FONT_SUFFIX}; do
- doins *.${suffix} || die "font installation failed" # TODO old EAPI cleanup
+ doins *.${suffix}
done
font_xfont_config
popd > /dev/null
@@ -198,10 +184,10 @@ font_src_install() {
font_fontconfig
- [[ -n ${DOCS} ]] && { dodoc ${DOCS} || die "docs installation failed" ; } # TODO old EAPI cleanup
+ einstalldocs
# install common docs
- for commondoc in COPYRIGHT README{,.md,.txt} NEWS AUTHORS BUGS ChangeLog FONTLOG.txt; do
+ for commondoc in COPYRIGHT FONTLOG.txt; do
[[ -s ${commondoc} ]] && dodoc ${commondoc}
done
}
@@ -238,9 +224,7 @@ font_pkg_postinst() {
elog "The following fontconfig configuration files have been installed:"
elog
for conffile in "${FONT_CONF[@]}"; do
- if [[ -e "${EROOT%/}"/etc/fonts/conf.avail/${conffile##*/} ]]; then
- elog " ${conffile##*/}"
- fi
+ [[ -e "${EROOT%/}"/etc/fonts/conf.avail/${conffile##*/} ]] && elog " ${conffile##*/}"
done
elog
elog "Use \`eselect fontconfig\` to enable/disable them."
@@ -256,3 +240,6 @@ font_pkg_postrm() {
font_cleanup_dirs
_update_fontcache
}
+
+_FONT_ECLASS=1
+fi
--
2.23.0
next reply other threads:[~2019-10-20 16:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-20 16:50 David Seifert [this message]
2019-10-20 17:45 ` [gentoo-dev] [PATCH] font.eclass: Ban EAPIs < 5 Ulrich Mueller
2019-10-20 17:51 ` David Seifert
2019-10-20 18:57 ` Ulrich Mueller
2019-10-20 19:28 ` David Seifert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191020165012.3498212-1-soap@gentoo.org \
--to=soap@gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox