From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 6F9B5138334 for ; Sun, 20 Oct 2019 16:50:31 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D3BF2E0BC1; Sun, 20 Oct 2019 16:50:27 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7CBB4E0BBC for ; Sun, 20 Oct 2019 16:50:27 +0000 (UTC) Received: from thinkpad.fritz.box (unknown [IPv6:2001:4060:c005:3f00:9491:b020:96bd:fae]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: soap) by smtp.gentoo.org (Postfix) with ESMTPSA id B86C534BD1B; Sun, 20 Oct 2019 16:50:25 +0000 (UTC) From: David Seifert To: gentoo-dev@lists.gentoo.org Cc: David Seifert Subject: [gentoo-dev] [PATCH] font.eclass: Ban EAPIs < 5 Date: Sun, 20 Oct 2019 18:50:12 +0200 Message-Id: <20191020165012.3498212-1-soap@gentoo.org> X-Mailer: git-send-email 2.23.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: 008b4d56-3580-494a-bda7-634a69eebf7e X-Archives-Hash: f56544b0be49c834a7ce67c27bfc96f4 * Add inherit guard like all modern eclasses Closes: https://bugs.gentoo.org/679658 Signed-off-by: David Seifert --- 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