public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] eclass: db-use - Update to eapi7-ver
@ 2018-08-24 17:28 Brian Evans
  2018-08-24 17:38 ` Mart Raudsepp
  2018-08-27 13:14 ` Brian Evans
  0 siblings, 2 replies; 3+ messages in thread
From: Brian Evans @ 2018-08-24 17:28 UTC (permalink / raw
  To: gentoo-dev

This is a very simple eclass which only calls these functions from eclasses:
ver_cut (EAPI 0-6)
get_libdir (EAPI 0-5)
get_libname (ALL EAPI)

I see no little reason to place die statements for unknown EAPIs.
Just changing the eclasses to better suit the latest EAPI should be OK.

Signed-off-by: Brian Evans <grknight@gentoo.org>
---
 eclass/db-use.eclass | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/eclass/db-use.eclass b/eclass/db-use.eclass
index 35f11df034a..83ae94799ca 100644
--- a/eclass/db-use.eclass
+++ b/eclass/db-use.eclass
@@ -1,10 +1,14 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # This is a common location for functions that aid the use of sys-libs/db
 #
 # Bugs: maintainer-needed@gentoo.org
 
-inherit versionator multilib
+# multilib is used for get_libname in all EAPI
+case "${EAPI:-0}" in
+	0|1|2|3|4|5|6) inherit eapi7-ver multilib ;;
+	*) inherit multilib ;;
+esac
 
 #Convert a version to a db slot
 db_ver_to_slot() {
@@ -38,7 +42,7 @@ db_findver() {
 	fi
 
 	PKG="$(best_version $1)"
-	VER="$(get_version_component_range 1-2 "${PKG/*db-/}")"
+	VER="$(ver_cut 1-2 "${PKG/*db-/}")"
 	if [ -d "${EPREFIX}"/usr/include/db$(db_ver_to_slot "$VER") ]; then
 		#einfo "Found db version ${VER}" >&2
 		echo -n "$VER"
-- 
2.18.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] [PATCH] eclass: db-use - Update to eapi7-ver
  2018-08-24 17:28 [gentoo-dev] [PATCH] eclass: db-use - Update to eapi7-ver Brian Evans
@ 2018-08-24 17:38 ` Mart Raudsepp
  2018-08-27 13:14 ` Brian Evans
  1 sibling, 0 replies; 3+ messages in thread
From: Mart Raudsepp @ 2018-08-24 17:38 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 2056 bytes --]

Ühel kenal päeval, R, 24.08.2018 kell 13:28, kirjutas Brian Evans:
> This is a very simple eclass which only calls these functions from
> eclasses:
> ver_cut (EAPI 0-6)
> get_libdir (EAPI 0-5)
> get_libname (ALL EAPI)
> 
> I see no little reason to place die statements for unknown EAPIs.
> Just changing the eclasses to better suit the latest EAPI should be
> OK.

I'm unsure about not dying on unknown EAPI, but the rest looks good, as
at least in main tree everything inheriting db-use and using
versionator functions themselves, do properly inherit from versionator
themselves, instead of relying on it via db-use.eclass indirectly.

Not dying on unknown EAPI is not a change in status quo, so I don't
mind it here and for future EAPI-8 I hope we look through the non-
limited eclasses before its introduction.

Mart

> Signed-off-by: Brian Evans <grknight@gentoo.org>
> ---
>  eclass/db-use.eclass | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/eclass/db-use.eclass b/eclass/db-use.eclass
> index 35f11df034a..83ae94799ca 100644
> --- a/eclass/db-use.eclass
> +++ b/eclass/db-use.eclass
> @@ -1,10 +1,14 @@
> -# Copyright 1999-2014 Gentoo Foundation
> +# Copyright 1999-2018 Gentoo Foundation
>  # Distributed under the terms of the GNU General Public License v2
>  # This is a common location for functions that aid the use of sys-
> libs/db
>  #
>  # Bugs: maintainer-needed@gentoo.org
>  
> -inherit versionator multilib
> +# multilib is used for get_libname in all EAPI
> +case "${EAPI:-0}" in
> +	0|1|2|3|4|5|6) inherit eapi7-ver multilib ;;
> +	*) inherit multilib ;;
> +esac
>  
>  #Convert a version to a db slot
>  db_ver_to_slot() {
> @@ -38,7 +42,7 @@ db_findver() {
>  	fi
>  
>  	PKG="$(best_version $1)"
> -	VER="$(get_version_component_range 1-2 "${PKG/*db-/}")"
> +	VER="$(ver_cut 1-2 "${PKG/*db-/}")"
>  	if [ -d "${EPREFIX}"/usr/include/db$(db_ver_to_slot "$VER")
> ]; then
>  		#einfo "Found db version ${VER}" >&2
>  		echo -n "$VER"

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 981 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] [PATCH] eclass: db-use - Update to eapi7-ver
  2018-08-24 17:28 [gentoo-dev] [PATCH] eclass: db-use - Update to eapi7-ver Brian Evans
  2018-08-24 17:38 ` Mart Raudsepp
@ 2018-08-27 13:14 ` Brian Evans
  1 sibling, 0 replies; 3+ messages in thread
From: Brian Evans @ 2018-08-27 13:14 UTC (permalink / raw
  To: gentoo-dev


[-- Attachment #1.1: Type: text/plain, Size: 1615 bytes --]

This is now committed with id 86416d2c4bf.

Brian

On 8/24/2018 1:28 PM, Brian Evans wrote:
> This is a very simple eclass which only calls these functions from eclasses:
> ver_cut (EAPI 0-6)
> get_libdir (EAPI 0-5)
> get_libname (ALL EAPI)
> 
> I see no little reason to place die statements for unknown EAPIs.
> Just changing the eclasses to better suit the latest EAPI should be OK.
> 
> Signed-off-by: Brian Evans <grknight@gentoo.org>
> ---
>  eclass/db-use.eclass | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/eclass/db-use.eclass b/eclass/db-use.eclass
> index 35f11df034a..83ae94799ca 100644
> --- a/eclass/db-use.eclass
> +++ b/eclass/db-use.eclass
> @@ -1,10 +1,14 @@
> -# Copyright 1999-2014 Gentoo Foundation
> +# Copyright 1999-2018 Gentoo Foundation
>  # Distributed under the terms of the GNU General Public License v2
>  # This is a common location for functions that aid the use of sys-libs/db
>  #
>  # Bugs: maintainer-needed@gentoo.org
>  
> -inherit versionator multilib
> +# multilib is used for get_libname in all EAPI
> +case "${EAPI:-0}" in
> +	0|1|2|3|4|5|6) inherit eapi7-ver multilib ;;
> +	*) inherit multilib ;;
> +esac
>  
>  #Convert a version to a db slot
>  db_ver_to_slot() {
> @@ -38,7 +42,7 @@ db_findver() {
>  	fi
>  
>  	PKG="$(best_version $1)"
> -	VER="$(get_version_component_range 1-2 "${PKG/*db-/}")"
> +	VER="$(ver_cut 1-2 "${PKG/*db-/}")"
>  	if [ -d "${EPREFIX}"/usr/include/db$(db_ver_to_slot "$VER") ]; then
>  		#einfo "Found db version ${VER}" >&2
>  		echo -n "$VER"
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 834 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-08-27 13:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-24 17:28 [gentoo-dev] [PATCH] eclass: db-use - Update to eapi7-ver Brian Evans
2018-08-24 17:38 ` Mart Raudsepp
2018-08-27 13:14 ` Brian Evans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox