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

2021-04-02 Thread Andreas Sturmlechner
On Donnerstag, 1. April 2021 23:42:10 CEST you wrote:
> > On Thu, 01 Apr 2021, Andreas Sturmlechner wrote:
> > 
> > +   [[ ${EAPI} == [5-7] ]] ||
> > +   die "Internal function ${FUNCNAME} is not available in 
>=EAPI-8."
> > +   _test-flag-PROG
> > +}
> 
> Any reason why this cannot say "... in EAPI ${EAPI}." as I had suggested
> earlier?
> 

None at all, I just forgot about it in v2. This is fixed and ready to view in 
the PR now.

Regards

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


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

2021-04-01 Thread Ulrich Mueller
> On Thu, 01 Apr 2021, Andreas Sturmlechner wrote:
 
> +# @FUNCTION: test-flag-PROG
> +# @USAGE:  
> +# @INTERNAL
> +# @DESCRIPTION:
> +# Returns shell true if  is supported by given ,
> +# else returns shell false.
>  test-flag-PROG() {
> + [[ ${EAPI} == [5-7] ]] ||
> + die "Internal function ${FUNCNAME} is not available in 
> >=EAPI-8."
> + _test-flag-PROG
> +}

Any reason why this cannot say "... in EAPI ${EAPI}." as I had suggested
earlier?

(Same for the other patches in the series.)


signature.asc
Description: PGP signature


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

2021-04-01 Thread Sergei Trofimovich
On Thu, 01 Apr 2021 11:59:48 +0200
Andreas Sturmlechner  wrote:

> From 7b063ec3f4e2a76c43cd5de8a81a0a30c0f87a6d Mon Sep 17 00:00:00 2001
> From: Andreas Sturmlechner 
> Date: Wed, 31 Mar 2021 00:27:27 +0200
> Subject: [PATCH 3/5] flag-o-matic.eclass: Make test-flag-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 d511a140592..e4fdfd0b62d 100644
> --- a/eclass/flag-o-matic.eclass
> +++ b/eclass/flag-o-matic.eclass
> @@ -459,7 +459,25 @@ strip-flags() {
>   return 0
>  }
>  
> +# @FUNCTION: test-flag-PROG
> +# @USAGE:  
> +# @INTERNAL
> +# @DESCRIPTION:
> +# Returns shell true if  is supported by given ,
> +# else returns shell false.
>  test-flag-PROG() {
> + [[ ${EAPI} == [5-7] ]] ||
> + die "Internal function ${FUNCNAME} is not available in 
> >=EAPI-8."

Yeah. Given that we use tc-get$1 in implementation it's not easy to
use as is in external code. Patch is ok. We can consider it later.

> + _test-flag-PROG
> +}
> +
> +# @FUNCTION: _test-flag-PROG
> +# @USAGE:  
> +# @INTERNAL
> +# @DESCRIPTION:
> +# Returns shell true if  is supported by given ,
> +# else returns shell false.
> +_test-flag-PROG() {
>   local comp=$1
>   local lang=$2
>   shift 2
> @@ -554,31 +572,31 @@ test-flag-PROG() {
>  # @USAGE: 
>  # @DESCRIPTION:
>  # Returns shell true if  is supported by the C compiler, else returns 
> shell false.
> -test-flag-CC() { test-flag-PROG "CC" c "$@"; }
> +test-flag-CC() { _test-flag-PROG "CC" c "$@"; }
>  
>  # @FUNCTION: test-flag-CXX
>  # @USAGE: 
>  # @DESCRIPTION:
>  # Returns shell true if  is supported by the C++ compiler, else 
> returns shell false.
> -test-flag-CXX() { test-flag-PROG "CXX" c++ "$@"; }
> +test-flag-CXX() { _test-flag-PROG "CXX" c++ "$@"; }
>  
>  # @FUNCTION: test-flag-F77
>  # @USAGE: 
>  # @DESCRIPTION:
>  # Returns shell true if  is supported by the Fortran 77 compiler, else 
> returns shell false.
> -test-flag-F77() { test-flag-PROG "F77" f77 "$@"; }
> +test-flag-F77() { _test-flag-PROG "F77" f77 "$@"; }
>  
>  # @FUNCTION: test-flag-FC
>  # @USAGE: 
>  # @DESCRIPTION:
>  # Returns shell true if  is supported by the Fortran 90 compiler, else 
> returns shell false.
> -test-flag-FC() { test-flag-PROG "FC" f95 "$@"; }
> +test-flag-FC() { _test-flag-PROG "FC" f95 "$@"; }
>  
>  # @FUNCTION: test-flag-CCLD
>  # @USAGE: 
>  # @DESCRIPTION:
>  # 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 "$@"; }
> +test-flag-CCLD() { _test-flag-PROG "CC" c+ld "$@"; }
>  
>  test-flags-PROG() {
>   local comp=$1
> -- 
> 2.31.0
> 


-- 

  Sergei


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


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

2021-04-01 Thread Andreas Sturmlechner
>From 7b063ec3f4e2a76c43cd5de8a81a0a30c0f87a6d Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner 
Date: Wed, 31 Mar 2021 00:27:27 +0200
Subject: [PATCH 3/5] flag-o-matic.eclass: Make test-flag-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 d511a140592..e4fdfd0b62d 100644
--- a/eclass/flag-o-matic.eclass
+++ b/eclass/flag-o-matic.eclass
@@ -459,7 +459,25 @@ strip-flags() {
return 0
 }
 
+# @FUNCTION: test-flag-PROG
+# @USAGE:  
+# @INTERNAL
+# @DESCRIPTION:
+# Returns shell true if  is supported by given ,
+# else returns shell false.
 test-flag-PROG() {
+   [[ ${EAPI} == [5-7] ]] ||
+   die "Internal function ${FUNCNAME} is not available in 
>=EAPI-8."
+   _test-flag-PROG
+}
+
+# @FUNCTION: _test-flag-PROG
+# @USAGE:  
+# @INTERNAL
+# @DESCRIPTION:
+# Returns shell true if  is supported by given ,
+# else returns shell false.
+_test-flag-PROG() {
local comp=$1
local lang=$2
shift 2
@@ -554,31 +572,31 @@ test-flag-PROG() {
 # @USAGE: 
 # @DESCRIPTION:
 # Returns shell true if  is supported by the C compiler, else returns 
shell false.
-test-flag-CC() { test-flag-PROG "CC" c "$@"; }
+test-flag-CC() { _test-flag-PROG "CC" c "$@"; }
 
 # @FUNCTION: test-flag-CXX
 # @USAGE: 
 # @DESCRIPTION:
 # Returns shell true if  is supported by the C++ compiler, else returns 
shell false.
-test-flag-CXX() { test-flag-PROG "CXX" c++ "$@"; }
+test-flag-CXX() { _test-flag-PROG "CXX" c++ "$@"; }
 
 # @FUNCTION: test-flag-F77
 # @USAGE: 
 # @DESCRIPTION:
 # Returns shell true if  is supported by the Fortran 77 compiler, else 
returns shell false.
-test-flag-F77() { test-flag-PROG "F77" f77 "$@"; }
+test-flag-F77() { _test-flag-PROG "F77" f77 "$@"; }
 
 # @FUNCTION: test-flag-FC
 # @USAGE: 
 # @DESCRIPTION:
 # Returns shell true if  is supported by the Fortran 90 compiler, else 
returns shell false.
-test-flag-FC() { test-flag-PROG "FC" f95 "$@"; }
+test-flag-FC() { _test-flag-PROG "FC" f95 "$@"; }
 
 # @FUNCTION: test-flag-CCLD
 # @USAGE: 
 # @DESCRIPTION:
 # 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 "$@"; }
+test-flag-CCLD() { _test-flag-PROG "CC" c+ld "$@"; }
 
 test-flags-PROG() {
local comp=$1
-- 
2.31.0



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