commit:     4e422af10af49e5da5eb9dab464d94596cb38e86
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Fri Jun 27 04:00:56 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jun 28 02:30:20 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=4e422af1

ebuild.sh: use contains_word() rather than has()

The contains_word() function addresses a use case for which the has()
function is rampantly misappropriated. Following its recent
introduction, almost every instance of the latter was replaced with the
former, wherever appropriate. However, one instance was missed in the
"ebuild.sh" unit. That oversight is duly addressed by this commit.

See-also: 3b0150e488972b02c45c71192507300d823a361f
See-also: 4a4631eef7186c29668a8c049d988b61469940fd
Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/ebuild.sh | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 50d2ee3674..a7f67a89b0 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -768,9 +768,11 @@ else
 
        # If ${EBUILD_FORCE_TEST} == 1 and USE came from ${T}/environment
        # then it might not have USE=test like it's supposed to here.
-       if [[ ${EBUILD_PHASE} == test && ${EBUILD_FORCE_TEST} == 1 ]] &&
-               ___in_portage_iuse test && ! has test ${USE} ; then
-
+       if [[ ${EBUILD_PHASE} == test ]] \
+               && [[ ${EBUILD_FORCE_TEST} == 1 ]] \
+               && ___in_portage_iuse test \
+               && ! contains_word test "${USE}"
+       then
                export USE+=" test"
        fi
        declare -r USE

Reply via email to