From a79ecbc121890ddb5bb3f0a060cf57ea751973dc Mon Sep 17 00:00:00 2001 From: Sam James Date: Sun, 20 Jun 2021 23:15:28 +0200 Subject: [PATCH] toolchain-funcs.eclass: [QA] add EAPI guard * Declare suppported EAPIs. * Add EAPI guard to prevent newer/older unsupported EAPIs from using this eclass when they've not been tested/eclass isn't adapted for it. Signed-off-by: Sam James Signed-off-by: David Seifert --- eclass/toolchain-funcs.eclass | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass index 267cf5cfce345..6806bd0883bbc 100644 --- a/eclass/toolchain-funcs.eclass +++ b/eclass/toolchain-funcs.eclass @@ -5,6 +5,7 @@ # @MAINTAINER: # Toolchain Ninjas # @BLURB: functions to query common info about the toolchain +# @SUPPORTED_EAPIS: 5 6 7 # @DESCRIPTION: # The toolchain-funcs aims to provide a complete suite of functions # for gleaning useful information about the toolchain and to simplify @@ -12,6 +13,11 @@ # in such a way that you can rely on the function always returning # something sane. +case ${EAPI:-0} in + [567]) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac + if [[ -z ${_TOOLCHAIN_FUNCS_ECLASS} ]]; then _TOOLCHAIN_FUNCS_ECLASS=1