[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gentoo-dev
Subject:    Re: [gentoo-dev] [PATCH eclass-manpages] Allow @INCLUDES_EPREFIX for path functions&variable
From:       Benda Xu <heroxbd () gentoo ! org>
Date:       2019-07-30 15:56:30
Message-ID: 87pnlro6s1.fsf () proton ! d ! airelinux ! org
[Download RAW message or body]

Michał Górny <mgorny@gentoo.org> writes:

> Add a new @INCLUDES_EPREFIX tag that indicates that a particular
> function (= getter) or variable is a path that includes ${EPREFIX}.
> This will be used in pkgcheck to detect accidental variable and getter
> combinations that result in double prefix.
>
> Signed-off-by: Michał Górny <mgorny@gentoo.org>
> ---
>  eclass-to-manpage.awk | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/eclass-to-manpage.awk b/eclass-to-manpage.awk
> index 44708d4..f8620c8 100755
> --- a/eclass-to-manpage.awk
> +++ b/eclass-to-manpage.awk
> @@ -33,6 +33,7 @@
>  # @MAINTAINER:
>  # <optional; list of contacts, one per line>
>  # [@INTERNAL]
> +# [@INCLUDES_EPREFIX] (the function outputs path that includes ${EPREFIX})
>  # @DESCRIPTION:
>  # <required if no @RETURN; blurb about this function>
>  
> @@ -42,6 +43,7 @@
>  # [@INTERNAL] (internal eclass use variable)
>  # [@DEFAULT_UNSET]
>  # [@REQUIRED]
> +# [@INCLUDES_EPREFIX] (the variable is a path that includes ${EPREFIX})
>  # @DESCRIPTION:
>  # <required; blurb about this variable>
>  # foo="<default value>"
> @@ -54,6 +56,7 @@
>  # [@INTERNAL] (internal eclass use variable)
>  # [@DEFAULT_UNSET]
>  # [@REQUIRED]
> +# [@INCLUDES_EPREFIX] (the variable is a path that includes ${EPREFIX})
>  # @DESCRIPTION:
>  # <required; blurb about this variable>
>  # foo="<default value>"
> @@ -252,6 +255,10 @@ function handle_function() {
>  		internal = 1
>  		getline
>  	}
> +	if ($2 == "@INCLUDES_EPREFIX") {
> +		includes_eprefix = 1
> +		getline
> +	}
>  	if ($2 == "@DESCRIPTION:")
>  		desc = eat_paragraph()
>  
> @@ -314,6 +321,8 @@ function _handle_variable() {
>  			user_variable = 1
>  		else if ($2 == "@OUTPUT_VARIABLE")
>  			output_variable = 1
> +		else if ($2 == "@INCLUDES_EPREFIX")
> +			includes_eprefix = 1
>  		else
>  			opts = 0
>  	}

That looks like a good idea.

Yours,
Benda

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic