diff options
Diffstat (limited to 'eclass/tests/tests-common.sh')
-rw-r--r-- | eclass/tests/tests-common.sh | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/eclass/tests/tests-common.sh b/eclass/tests/tests-common.sh index 3bba4946963b..8b6869bc5b47 100644 --- a/eclass/tests/tests-common.sh +++ b/eclass/tests/tests-common.sh @@ -27,5 +27,13 @@ debug-print-section() { debug-print "now in section ${*}" } -hasq() { [[ " ${*:2} " == *" $1 "* ]]; } -has() { hasq "$@"; } +has() { + local needle=$1 + shift + + local x + for x in "$@"; do + [ "${x}" = "${needle}" ] && return 0 + done + return 1 +} |