aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Bo ├śrsted Andresen <bo.andresen@zlin.dk> 2012-09-19 00:25:43 +0200
committerAvatar Bo ├śrsted Andresen <bo.andresen@zlin.dk> 2012-09-19 01:52:53 +0200
commitc5c7c2d799046cebffd524f50f83aed13646400d (patch)
treed1d521bb5a4b16f9fccf8a66e2f9a1a146ff7705
parenta39850d8b6ea39ffc8b59580c3af73935a415f5a (diff)
downloadpaludis-c5c7c2d799046cebffd524f50f83aed13646400d.tar.gz
paludis-c5c7c2d799046cebffd524f50f83aed13646400d.tar.xz
Fix expecting_tests.
`expecting_tests --any --enable-foo --disable-foo` should do the same thing as `expecting_tests --enable-foo --disable-foo`. `expecting_tests --foo --foo --bar` should fail. `expecting_tests --foo` should not echo an empty line if no tests are enabled.
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/list_functions.bash17
1 files changed, 10 insertions, 7 deletions
diff --git a/paludis/repositories/e/ebuild/exheres-0/list_functions.bash b/paludis/repositories/e/ebuild/exheres-0/list_functions.bash
index fbe66ff..dfc324f 100644
--- a/paludis/repositories/e/ebuild/exheres-0/list_functions.bash
+++ b/paludis/repositories/e/ebuild/exheres-0/list_functions.bash
@@ -95,13 +95,16 @@ hasq()
expecting_tests()
{
- local r=$(paludis_pipe_command EXPECTING_TESTS "$EAPI" "${1:---any}" )
- if [[ "${#@}" -gt 1 ]] ; then
- if [[ ${r%%;*} -eq 0 ]] ; then
- echo "${2}"
- else
- echo "${3}"
- fi
+ local a r
+ case "${1}" in
+ --any|--recommended|--expensive) a="${1}"; shift ;;
+ esac
+ r=$(paludis_pipe_command EXPECTING_TESTS "$EAPI" "${a:---any}" )
+ [[ "${#@}" -gt 2 ]] && die "$0 takes at most three arguments"
+ if [[ ${r%%;*} -eq 0 ]] ; then
+ [[ -n "${1}" ]] && echo "${1}"
+ else
+ [[ -n "${2}" ]] && echo "${2}"
fi
return ${r%%;*}
}