commit:     7c8edfbb8001d447c6f02695954ed9e348dbd088
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed May 12 12:06:06 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon May 24 04:33:49 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7c8edfbb

Ban hasq, hasv and useq in EAPI 8

Bug: https://bugs.gentoo.org/199722
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/eapi.sh               | 14 +++++++++++++-
 bin/isolated-functions.sh |  6 +++++-
 bin/phase-helpers.sh      |  4 +++-
 3 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index e2b6f62a0..b03871690 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 2012-2018 Gentoo Foundation
+# Copyright 2012-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # PHASES
@@ -128,6 +128,18 @@ ___eapi_has_version_functions() {
        [[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6)$ 
]]
 }
 
+___eapi_has_hasq() {
+       [[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6|7)$ 
]]
+}
+
+___eapi_has_hasv() {
+       [[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6|7)$ 
]]
+}
+
+___eapi_has_useq() {
+       [[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6|7)$ 
]]
+}
+
 ___eapi_has_master_repositories() {
        [[ ${1-${EAPI-0}} =~ ^(5-progress)$ ]]
 }

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index ba224b96f..b495ae6c7 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 source "${PORTAGE_BIN_PATH}/eapi.sh" || exit 1
@@ -475,11 +475,15 @@ ___parallel_xargs() {
 }
 
 hasq() {
+       ___eapi_has_hasq || die "'${FUNCNAME}' banned in EAPI ${EAPI}"
+
        eqawarn "QA Notice: The 'hasq' function is deprecated (replaced by 
'has')"
        has "$@"
 }
 
 hasv() {
+       ___eapi_has_hasv || die "'${FUNCNAME}' banned in EAPI ${EAPI}"
+
        if has "$@" ; then
                echo "$1"
                return 0

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 116c233fb..7a82dad20 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 if ___eapi_has_DESTTREE_INSDESTTREE; then
@@ -190,6 +190,8 @@ dostrip() {
 }
 
 useq() {
+       ___eapi_has_useq || die "'${FUNCNAME}' banned in EAPI ${EAPI}"
+
        eqawarn "QA Notice: The 'useq' function is deprecated (replaced by 
'use')"
        use ${1}
 }

Reply via email to