Re: [gentoo-dev] [PATCH] fcaps.eclass: use BDEPEND for EAPI 7

2020-03-13 Thread Mike Gilbert
On Fri, Mar 13, 2020 at 2:23 PM David Michael  wrote:
>
> The eclass installs libcap to execute the setcap program, so it
> must be installed in /.  Optional libcap linking is handled by the
> USE=caps flag, which is unrelated to this eclass, so the DEPEND
> declaration is not needed on EAPI 7.
>
> Closes: https://bugs.gentoo.org/700018
> Signed-off-by: David Michael 
> ---
>  eclass/fcaps.eclass | 7 +--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/eclass/fcaps.eclass b/eclass/fcaps.eclass
> index 467f955f5e9..b0479f32456 100644
> --- a/eclass/fcaps.eclass
> +++ b/eclass/fcaps.eclass
> @@ -1,4 +1,4 @@
> -# Copyright 1999-2015 Gentoo Foundation
> +# Copyright 1999-2020 Gentoo Authors
>  # Distributed under the terms of the GNU General Public License v2
>
>  # @ECLASS: fcaps.eclass
> @@ -34,7 +34,10 @@ _FCAPS_ECLASS=1
>  IUSE="+filecaps"
>
>  # We can't use libcap-ng atm due to #471414.
> -DEPEND="filecaps? ( sys-libs/libcap )"
> +case "${EAPI:-0}" in
> +   7) BDEPEND="filecaps? ( sys-libs/libcap )" ;;
> +   *) DEPEND="filecaps? ( sys-libs/libcap )" ;;
> +esac

Please reverse the logic: if EAPI is in 0-6, set DEPEND, otherwise set
BDEPEND. Assuming future EAPIs support BDEPEND, this will future-proof
the eclass somewhat.



[gentoo-dev] [PATCH] fcaps.eclass: use BDEPEND for EAPI 7

2020-03-13 Thread David Michael
The eclass installs libcap to execute the setcap program, so it
must be installed in /.  Optional libcap linking is handled by the
USE=caps flag, which is unrelated to this eclass, so the DEPEND
declaration is not needed on EAPI 7.

Closes: https://bugs.gentoo.org/700018
Signed-off-by: David Michael 
---
 eclass/fcaps.eclass | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/eclass/fcaps.eclass b/eclass/fcaps.eclass
index 467f955f5e9..b0479f32456 100644
--- a/eclass/fcaps.eclass
+++ b/eclass/fcaps.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: fcaps.eclass
@@ -34,7 +34,10 @@ _FCAPS_ECLASS=1
 IUSE="+filecaps"
 
 # We can't use libcap-ng atm due to #471414.
-DEPEND="filecaps? ( sys-libs/libcap )"
+case "${EAPI:-0}" in
+   7) BDEPEND="filecaps? ( sys-libs/libcap )" ;;
+   *) DEPEND="filecaps? ( sys-libs/libcap )" ;;
+esac
 
 # @ECLASS-VARIABLE: FILECAPS
 # @DEFAULT_UNSET
-- 
2.21.1