Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Sun, 20 Jun 2021 21:16:20
Message-Id: 1624223728.a79ecbc121890ddb5bb3f0a060cf57ea751973dc.soap@gentoo
1 commit: a79ecbc121890ddb5bb3f0a060cf57ea751973dc
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jun 20 21:15:28 2021 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Sun Jun 20 21:15:28 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a79ecbc1
7
8 toolchain-funcs.eclass: [QA] add EAPI guard
9
10 * Declare suppported EAPIs.
11 * Add EAPI guard to prevent newer/older unsupported EAPIs from using this
12 eclass when they've not been tested/eclass isn't adapted for it.
13
14 Signed-off-by: Sam James <sam <AT> gentoo.org>
15 Signed-off-by: David Seifert <soap <AT> gentoo.org>
16
17 eclass/toolchain-funcs.eclass | 6 ++++++
18 1 file changed, 6 insertions(+)
19
20 diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
21 index 267cf5cfce3..6806bd0883b 100644
22 --- a/eclass/toolchain-funcs.eclass
23 +++ b/eclass/toolchain-funcs.eclass
24 @@ -5,6 +5,7 @@
25 # @MAINTAINER:
26 # Toolchain Ninjas <toolchain@g.o>
27 # @BLURB: functions to query common info about the toolchain
28 +# @SUPPORTED_EAPIS: 5 6 7
29 # @DESCRIPTION:
30 # The toolchain-funcs aims to provide a complete suite of functions
31 # for gleaning useful information about the toolchain and to simplify
32 @@ -12,6 +13,11 @@
33 # in such a way that you can rely on the function always returning
34 # something sane.
35
36 +case ${EAPI:-0} in
37 + [567]) ;;
38 + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
39 +esac
40 +
41 if [[ -z ${_TOOLCHAIN_FUNCS_ECLASS} ]]; then
42 _TOOLCHAIN_FUNCS_ECLASS=1