Gentoo Archives: gentoo-portage-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-portage-dev@l.g.o
Cc: "Ulrich Müller" <ulm@g.o>
Subject: Re: [gentoo-portage-dev] [PATCH v2 1/2] Revert "Revert "Generate a QA Notice when EXPORT_FUNCTIONS is called before inherit""
Date: Fri, 03 Sep 2021 11:34:43
Message-Id: 5a4ccf630c0ed5d9c61ff7eaf897c309393138e4.camel@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH v2 1/2] Revert "Revert "Generate a QA Notice when EXPORT_FUNCTIONS is called before inherit"" by "Ulrich Müller"
1 On Mon, 2021-08-30 at 08:22 +0200, Ulrich Müller wrote:
2 > Reinstate the QA notice, because Portage behavior deviates from PMS,
3 > and breakage of eclasses with Pkgcore has been observed recently.
4 >
5 > This reverts commit f44d32550861cb25c209ef61dcd7ae1aa230da1f.
6 >
7 > Bug: https://bugs.gentoo.org/399039
8 > Signed-off-by: Ulrich Müller <ulm@g.o>
9 > ---
10 > bin/ebuild.sh | 8 ++++++++
11 > 1 file changed, 8 insertions(+)
12 >
13 > diff --git a/bin/ebuild.sh b/bin/ebuild.sh
14 > index 5916bedfc..1bca2c965 100755
15 > --- a/bin/ebuild.sh
16 > +++ b/bin/ebuild.sh
17 > @@ -243,6 +243,14 @@ inherit() {
18 > ECLASS_DEPTH=$(($ECLASS_DEPTH + 1))
19 > if [[ ${ECLASS_DEPTH} -gt 1 ]]; then
20 > debug-print "*** Multiple Inheritence (Level: ${ECLASS_DEPTH})"
21 > +
22 > + # Since ECLASS_DEPTH > 1, the following variables are locals from the
23 > + # previous inherit call in the call stack.
24 > + if [[ -n ${ECLASS} && -n ${!__export_funcs_var} ]] ; then
25 > + eqawarn "QA Notice: EXPORT_FUNCTIONS is called before inherit in ${ECLASS}.eclass."
26 > + eqawarn "For compatibility with <=portage-2.1.6.7, only call EXPORT_FUNCTIONS"
27 > + eqawarn "after inherit(s)."
28 > + fi
29 > fi
30 >
31 > local -x ECLASS
32
33 Merged both.
34
35 --
36 Best regards,
37 Michał Górny