summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Harring <ferringb@gmail.com>2011-07-11 01:33:21 -0700
committerZac Medico <zmedico@gentoo.org>2011-07-11 07:26:28 -0700
commitf8504d36c50bef4c1a982a4b9262d3e8e15f438b (patch)
tree136293d01d0afe69ebaaebeaa0847ded84d15238
parent774ab66e9cc55f749052d690421765647c9c9c9c (diff)
downloadportage-f8504d36c50bef4c1a982a4b9262d3e8e15f438b.tar.gz
portage-f8504d36c50bef4c1a982a4b9262d3e8e15f438b.tar.bz2
portage-f8504d36c50bef4c1a982a4b9262d3e8e15f438b.zip
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 <ferringb@gmail.com>
-rw-r--r--bin/isolated-functions.sh9
1 files changed, 8 insertions, 1 deletions
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