commit: c54b9fc0e02e07d4af019d81de611c865521b369 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org> AuthorDate: Sat Jul 23 19:19:38 2022 +0000 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> CommitDate: Sun Jul 24 17:49:42 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c54b9fc0
eqawarn.eclass: New eclass, split off from eutils Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org> eclass/eqawarn.eclass | 26 ++++++++++++++++++++++++++ eclass/eutils.eclass | 15 +-------------- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/eclass/eqawarn.eclass b/eclass/eqawarn.eclass new file mode 100644 index 000000000000..288976182fb3 --- /dev/null +++ b/eclass/eqawarn.eclass @@ -0,0 +1,26 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: eqawarn.eclass +# @MAINTAINER: +# base-sys...@gentoo.org +# @SUPPORTED_EAPIS: 6 +# @BLURB: output a QA warning + +case ${EAPI} in + 6) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac + +# @FUNCTION: eqawarn +# @USAGE: [message] +# @DESCRIPTION: +# Proxy to ewarn for package managers that don't provide eqawarn and +# use the PM implementation if available. Reuses PORTAGE_ELOG_CLASSES +# as set by the dev profile. +if ! declare -F eqawarn >/dev/null ; then + eqawarn() { + has qa ${PORTAGE_ELOG_CLASSES} && ewarn "$@" + : + } +fi diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index e7fae2c656c6..b1479d33049c 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -24,7 +24,7 @@ _EUTILS_ECLASS=1 # implicitly inherited (now split) eclasses case ${EAPI} in - 6) inherit desktop edos2unix epatch estack ltprune multilib \ + 6) inherit desktop edos2unix epatch eqawarn estack ltprune multilib \ preserve-libs strip-linguas toolchain-funcs vcs-clean wrapper ;; 7) inherit edos2unix strip-linguas wrapper ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; @@ -50,17 +50,4 @@ use_if_iuse() { die "use_if_iuse is banned" } -# @FUNCTION: eqawarn -# @USAGE: [message] -# @DESCRIPTION: -# Proxy to ewarn for package managers that don't provide eqawarn and use the PM -# implementation if available. Reuses PORTAGE_ELOG_CLASSES as set by the dev -# profile. -if [[ ${EAPI} == 6 ]] && ! declare -F eqawarn >/dev/null ; then - eqawarn() { - has qa ${PORTAGE_ELOG_CLASSES} && ewarn "$@" - : - } -fi - fi