Re: [gentoo-dev] [PATCH v2 4/5] flag-o-matic.eclass: get rid of eutils in

2021-04-01 Thread Sergei Trofimovich
On Thu, 01 Apr 2021 12:01:24 +0200
Andreas Sturmlechner  wrote:

> From 797d26ad9fe861c9c332f54a0f856a17af32ee53 Mon Sep 17 00:00:00 2001
> From: Andreas Sturmlechner 
> Date: Wed, 31 Mar 2021 00:29:55 +0200
> Subject: [PATCH 4/5] flag-o-matic.eclass: Make test-flags-PROG() internal
> 
> Signed-off-by: Andreas Sturmlechner 
> ---
>  eclass/flag-o-matic.eclass | 28 +++-
>  1 file changed, 23 insertions(+), 5 deletions(-)
> 
> diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
> index e4fdfd0b62d..a35f0bef269 100644
> --- a/eclass/flag-o-matic.eclass
> +++ b/eclass/flag-o-matic.eclass
> @@ -598,7 +598,25 @@ test-flag-FC() { _test-flag-PROG "FC" f95 "$@"; }
>  # Returns shell true if  is supported by the C compiler and linker, 
> else returns shell false.
>  test-flag-CCLD() { _test-flag-PROG "CC" c+ld "$@"; }
>  
> +# @FUNCTION: test-flags-PROG
> +# @USAGE:   [more flags...]
> +# @INTERNAL
> +# @DESCRIPTION:
> +# Returns shell true if  are supported by given ,
> +# else returns shell false.
>  test-flags-PROG() {
> + [[ ${EAPI} == [5-7] ]] ||

'[[ ${EAPI} == [567] ]] ||'. Otherwise patch looks ok.

> + die "Internal function ${FUNCNAME} is not available in 
> >=EAPI-8."
> + _test-flags-PROG
> +}
> +
> +# @FUNCTION: _test-flags-PROG
> +# @USAGE:   [more flags...]
> +# @INTERNAL
> +# @DESCRIPTION:
> +# Returns shell true if  are supported by given ,
> +# else returns shell false.
> +_test-flags-PROG() {
>   local comp=$1
>   local flags=()
>   local x
> @@ -635,31 +653,31 @@ test-flags-PROG() {
>  # @USAGE: 
>  # @DESCRIPTION:
>  # Returns shell true if  are supported by the C compiler, else 
> returns shell false.
> -test-flags-CC() { test-flags-PROG "CC" "$@"; }
> +test-flags-CC() { _test-flags-PROG "CC" "$@"; }
>  
>  # @FUNCTION: test-flags-CXX
>  # @USAGE: 
>  # @DESCRIPTION:
>  # Returns shell true if  are supported by the C++ compiler, else 
> returns shell false.
> -test-flags-CXX() { test-flags-PROG "CXX" "$@"; }
> +test-flags-CXX() { _test-flags-PROG "CXX" "$@"; }
>  
>  # @FUNCTION: test-flags-F77
>  # @USAGE: 
>  # @DESCRIPTION:
>  # Returns shell true if  are supported by the Fortran 77 compiler, 
> else returns shell false.
> -test-flags-F77() { test-flags-PROG "F77" "$@"; }
> +test-flags-F77() { _test-flags-PROG "F77" "$@"; }
>  
>  # @FUNCTION: test-flags-FC
>  # @USAGE: 
>  # @DESCRIPTION:
>  # Returns shell true if  are supported by the Fortran 90 compiler, 
> else returns shell false.
> -test-flags-FC() { test-flags-PROG "FC" "$@"; }
> +test-flags-FC() { _test-flags-PROG "FC" "$@"; }
>  
>  # @FUNCTION: test-flags-CCLD
>  # @USAGE: 
>  # @DESCRIPTION:
>  # Returns shell true if  are supported by the C compiler and default 
> linker, else returns shell false.
> -test-flags-CCLD() { test-flags-PROG "CCLD" "$@"; }
> +test-flags-CCLD() { _test-flags-PROG "CCLD" "$@"; }
>  
>  # @FUNCTION: test-flags
>  # @USAGE: 
> -- 
> 2.31.0
> 


-- 

  Sergei


pgp2FJQCfhNCe.pgp
Description: Цифровая подпись OpenPGP


Re: [gentoo-dev] [PATCH v2 4/5] flag-o-matic.eclass: get rid of eutils in

2021-04-01 Thread Andreas Sturmlechner
>From 797d26ad9fe861c9c332f54a0f856a17af32ee53 Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner 
Date: Wed, 31 Mar 2021 00:29:55 +0200
Subject: [PATCH 4/5] flag-o-matic.eclass: Make test-flags-PROG() internal

Signed-off-by: Andreas Sturmlechner 
---
 eclass/flag-o-matic.eclass | 28 +++-
 1 file changed, 23 insertions(+), 5 deletions(-)

diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
index e4fdfd0b62d..a35f0bef269 100644
--- a/eclass/flag-o-matic.eclass
+++ b/eclass/flag-o-matic.eclass
@@ -598,7 +598,25 @@ test-flag-FC() { _test-flag-PROG "FC" f95 "$@"; }
 # Returns shell true if  is supported by the C compiler and linker, else 
returns shell false.
 test-flag-CCLD() { _test-flag-PROG "CC" c+ld "$@"; }
 
+# @FUNCTION: test-flags-PROG
+# @USAGE:   [more flags...]
+# @INTERNAL
+# @DESCRIPTION:
+# Returns shell true if  are supported by given ,
+# else returns shell false.
 test-flags-PROG() {
+   [[ ${EAPI} == [5-7] ]] ||
+   die "Internal function ${FUNCNAME} is not available in 
>=EAPI-8."
+   _test-flags-PROG
+}
+
+# @FUNCTION: _test-flags-PROG
+# @USAGE:   [more flags...]
+# @INTERNAL
+# @DESCRIPTION:
+# Returns shell true if  are supported by given ,
+# else returns shell false.
+_test-flags-PROG() {
local comp=$1
local flags=()
local x
@@ -635,31 +653,31 @@ test-flags-PROG() {
 # @USAGE: 
 # @DESCRIPTION:
 # Returns shell true if  are supported by the C compiler, else returns 
shell false.
-test-flags-CC() { test-flags-PROG "CC" "$@"; }
+test-flags-CC() { _test-flags-PROG "CC" "$@"; }
 
 # @FUNCTION: test-flags-CXX
 # @USAGE: 
 # @DESCRIPTION:
 # Returns shell true if  are supported by the C++ compiler, else 
returns shell false.
-test-flags-CXX() { test-flags-PROG "CXX" "$@"; }
+test-flags-CXX() { _test-flags-PROG "CXX" "$@"; }
 
 # @FUNCTION: test-flags-F77
 # @USAGE: 
 # @DESCRIPTION:
 # Returns shell true if  are supported by the Fortran 77 compiler, else 
returns shell false.
-test-flags-F77() { test-flags-PROG "F77" "$@"; }
+test-flags-F77() { _test-flags-PROG "F77" "$@"; }
 
 # @FUNCTION: test-flags-FC
 # @USAGE: 
 # @DESCRIPTION:
 # Returns shell true if  are supported by the Fortran 90 compiler, else 
returns shell false.
-test-flags-FC() { test-flags-PROG "FC" "$@"; }
+test-flags-FC() { _test-flags-PROG "FC" "$@"; }
 
 # @FUNCTION: test-flags-CCLD
 # @USAGE: 
 # @DESCRIPTION:
 # Returns shell true if  are supported by the C compiler and default 
linker, else returns shell false.
-test-flags-CCLD() { test-flags-PROG "CCLD" "$@"; }
+test-flags-CCLD() { _test-flags-PROG "CCLD" "$@"; }
 
 # @FUNCTION: test-flags
 # @USAGE: 
-- 
2.31.0



signature.asc
Description: This is a digitally signed message part.