commit:     afaf72e840d910c17e23335c8069c5bd40faf4f7
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon Jun  9 08:01:24 2025 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Aug 17 19:00:35 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=afaf72e8

EAPI 9 bans assert

When rebasing, I had to partially revert commit 6f9971e54d, because
the value of PIPESTATUS must be saved before the feature test call

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 bin/eapi.sh               | 1 +
 bin/isolated-functions.sh | 8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index 8618815b8d..892742c5d1 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -24,6 +24,7 @@ ___eapi_has_prefix_variables()         [[ ${1-${EAPI-0}} != 
[0-2] ]]
 
 # HELPERS PRESENCE
 
+___eapi_has_assert()             [[ ${1-${EAPI-0}} == [0-8] ]]
 ___eapi_has_docompress()         [[ ${1-${EAPI-0}} != [0-3] ]]
 ___eapi_has_dohard()             [[ ${1-${EAPI-0}} == [0-3] ]]
 ___eapi_has_doheader()           [[ ${1-${EAPI-0}} != [0-4] ]]

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index a1c431694e..0fd9c8bd99 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 # shellcheck disable=2128,2185,2219
 
@@ -23,7 +23,11 @@ fi
 shopt -s expand_aliases
 
 assert() {
-       IFS='|' expression=${PIPESTATUS[*]} let '! expression' || die "$@"
+       local x pipestatus=( "${PIPESTATUS[@]}" )
+       ___eapi_has_assert || die "'${FUNCNAME}' banned in EAPI ${EAPI}"
+       for x in "${pipestatus[@]}"; do
+               [[ ${x} -eq 0 ]] || die "$@"
+       done
 }
 
 shopt -s extdebug

Reply via email to