Gentoo Archives: gentoo-commits

From: Florian Schmaus <flow@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Tue, 22 Feb 2022 07:36:11
Message-Id: 1645515138.52acf58202ee276674745962306d6cb00223f5e2.flow@gentoo
1 commit: 52acf58202ee276674745962306d6cb00223f5e2
2 Author: Florian Schmaus <flow <AT> gentoo <DOT> org>
3 AuthorDate: Fri Feb 18 08:44:13 2022 +0000
4 Commit: Florian Schmaus <flow <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 22 07:32:18 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=52acf582
7
8 db-use.eclass: add support for EAPI 8, die on unknown EAPI
9
10 Add support for EAPI 8 and drop support for EAPIs < 5. Also explicitly
11 die on unknown EAPI values. Note that this is a deviation from the
12 currenty approach that the eclass uses since 86416d2c4bf1 ("eclass:
13 db-use - Update to eapi7-ver"). But I argue that it is confusing that
14 your static ananlysis tools (pkgcheck, repoman) complain about an
15 unsupported EAPI in an eclass, while the ebuild works just fine. While I
16 also think it is likely that this eclass will support future EAPI
17 versions without any modifications, my conclusion is that this is actually
18 an argument to die on unknown EAPIs, since it is trivial to bump, while
19 on the other hand, you never know if it really works.
20
21 Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
22 Closes: https://github.com/gentoo/gentoo/pull/24246
23 Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
24
25 eclass/db-use.eclass | 14 ++++++--------
26 1 file changed, 6 insertions(+), 8 deletions(-)
27
28 diff --git a/eclass/db-use.eclass b/eclass/db-use.eclass
29 index d23b08d19996..55e72286fda4 100644
30 --- a/eclass/db-use.eclass
31 +++ b/eclass/db-use.eclass
32 @@ -1,4 +1,4 @@
33 -# Copyright 1999-2021 Gentoo Authors
34 +# Copyright 1999-2022 Gentoo Authors
35 # Distributed under the terms of the GNU General Public License v2
36 # This is a common location for functions that aid the use of sys-libs/db
37 #
38 @@ -8,16 +8,17 @@
39 # maintainer-needed@g.o
40 # @AUTHOR:
41 # Paul de Vrieze <pauldv@g.o>
42 -# @SUPPORTED_EAPIS: 5 6 7
43 +# @SUPPORTED_EAPIS: 5 6 7 8
44 # @BLURB: This is a common location for functions that aid the use of sys-libs/db
45 # @DESCRIPTION:
46 # This eclass is designed to provide helpful functions for depending on
47 # sys-libs/db.
48
49 # multilib is used for get_libname in all EAPI
50 -case "${EAPI:-0}" in
51 - 0|1|2|3|4|5|6) inherit eapi7-ver multilib ;;
52 - *) inherit multilib ;;
53 +case ${EAPI} in
54 + 5|6) inherit eapi7-ver ;& # fallthrough
55 + 7|8) inherit multilib ;;
56 + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
57 esac
58
59 #Convert a version to a db slot
60 @@ -40,7 +41,6 @@ db_ver_to_slot() {
61
62 #Find the version that correspond to the given atom
63 db_findver() {
64 - has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
65 if [ $# -ne 1 ]; then
66 eerror "Function db_findver needs one argument" >&2
67 eerror "args given:" >&2
68 @@ -68,7 +68,6 @@ db_findver() {
69 # to test for, it will aim to find the library corresponding to it.
70
71 db_includedir() {
72 - has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
73 if [ $# -eq 0 ]; then
74 VER="$(db_findver sys-libs/db)" || return 1
75 VER="$(db_ver_to_slot "$VER")"
76 @@ -102,7 +101,6 @@ db_includedir() {
77 # packages to test for, it will aim to find the library corresponding to it.
78
79 db_libname() {
80 - has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
81 if [ $# -eq 0 ]; then
82 VER="$(db_findver sys-libs/db)" || return 1
83 if [ -e "${EPREFIX}/usr/$(get_libdir)/libdb-${VER}$(get_libname)" ]; then