From f8504d36c50bef4c1a982a4b9262d3e8e15f438b Mon Sep 17 00:00:00 2001 From: Brian Harring Date: Mon, 11 Jul 2011 01:33:21 -0700 Subject: [PATCH] ebuild.sh: restore old has() implementation The needle/haystack implementation handles whitespace as originally intended (prior to commit 659eafddd5964820ce8bdc0d90f5fcf7df04b5b7), as discussed in bug #374791. Signed-off-by: Brian Harring --- bin/isolated-functions.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index 9d633973b..574f949d7 100644 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -525,7 +525,14 @@ hasv() { } has() { - [[ " ${*:2} " == *" $1 "* ]] + local needle=$1 + shift + + local x + for x in "$@"; do + [ "${x}" = "${needle}" ] && return 0 + done + return 1 } # @FUNCTION: save_ebuild_env -- 2.26.2