Gentoo Archives: gentoo-dev

From: Benda Xu <heroxbd@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH eclass-manpages] Allow @INCLUDES_EPREFIX for path functions&variable
Date: Tue, 30 Jul 2019 15:56:38
Message-Id: 87pnlro6s1.fsf@proton.d.airelinux.org
In Reply to: [gentoo-dev] [PATCH eclass-manpages] Allow @INCLUDES_EPREFIX for path functions&variable by "Michał Górny"
1 Michał Górny <mgorny@g.o> writes:
2
3 > Add a new @INCLUDES_EPREFIX tag that indicates that a particular
4 > function (= getter) or variable is a path that includes ${EPREFIX}.
5 > This will be used in pkgcheck to detect accidental variable and getter
6 > combinations that result in double prefix.
7 >
8 > Signed-off-by: Michał Górny <mgorny@g.o>
9 > ---
10 > eclass-to-manpage.awk | 9 +++++++++
11 > 1 file changed, 9 insertions(+)
12 >
13 > diff --git a/eclass-to-manpage.awk b/eclass-to-manpage.awk
14 > index 44708d4..f8620c8 100755
15 > --- a/eclass-to-manpage.awk
16 > +++ b/eclass-to-manpage.awk
17 > @@ -33,6 +33,7 @@
18 > # @MAINTAINER:
19 > # <optional; list of contacts, one per line>
20 > # [@INTERNAL]
21 > +# [@INCLUDES_EPREFIX] (the function outputs path that includes ${EPREFIX})
22 > # @DESCRIPTION:
23 > # <required if no @RETURN; blurb about this function>
24 >
25 > @@ -42,6 +43,7 @@
26 > # [@INTERNAL] (internal eclass use variable)
27 > # [@DEFAULT_UNSET]
28 > # [@REQUIRED]
29 > +# [@INCLUDES_EPREFIX] (the variable is a path that includes ${EPREFIX})
30 > # @DESCRIPTION:
31 > # <required; blurb about this variable>
32 > # foo="<default value>"
33 > @@ -54,6 +56,7 @@
34 > # [@INTERNAL] (internal eclass use variable)
35 > # [@DEFAULT_UNSET]
36 > # [@REQUIRED]
37 > +# [@INCLUDES_EPREFIX] (the variable is a path that includes ${EPREFIX})
38 > # @DESCRIPTION:
39 > # <required; blurb about this variable>
40 > # foo="<default value>"
41 > @@ -252,6 +255,10 @@ function handle_function() {
42 > internal = 1
43 > getline
44 > }
45 > + if ($2 == "@INCLUDES_EPREFIX") {
46 > + includes_eprefix = 1
47 > + getline
48 > + }
49 > if ($2 == "@DESCRIPTION:")
50 > desc = eat_paragraph()
51 >
52 > @@ -314,6 +321,8 @@ function _handle_variable() {
53 > user_variable = 1
54 > else if ($2 == "@OUTPUT_VARIABLE")
55 > output_variable = 1
56 > + else if ($2 == "@INCLUDES_EPREFIX")
57 > + includes_eprefix = 1
58 > else
59 > opts = 0
60 > }
61
62 That looks like a good idea.
63
64 Yours,
65 Benda