aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpaludis/repositories/e/ebuild/exheres-0/conditional_functions.bash12
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/list_functions.bash15
2 files changed, 11 insertions, 16 deletions
diff --git a/paludis/repositories/e/ebuild/exheres-0/conditional_functions.bash b/paludis/repositories/e/ebuild/exheres-0/conditional_functions.bash
index 4f6642fbf..1795cab19 100755
--- a/paludis/repositories/e/ebuild/exheres-0/conditional_functions.bash
+++ b/paludis/repositories/e/ebuild/exheres-0/conditional_functions.bash
@@ -32,19 +32,11 @@ use_enable()
option_with()
{
- if optionq "${1}" ; then
- echo "--with-${2:-$(optionfmt ${1} )}${3+=${3}}"
- else
- echo "--without-${2:-$(optionfmt ${1} )}"
- fi
+ option "${1}" "--with-${2:-$(optionfmt ${1} )}${3+=${3}}" "--without-${2:-$(optionfmt ${1} )}"
}
option_enable()
{
- if optionq "${1}" ; then
- echo "--enable-${2:-$(optionfmt ${1} )}${3+=${3}}"
- else
- echo "--disable-${2:-$(optionfmt ${1} )}"
- fi
+ option "${1}" "--enable-${2:-$(optionfmt ${1} )}${3+=${3}}" "--disable-${2:-$(optionfmt ${1} )}"
}
diff --git a/paludis/repositories/e/ebuild/exheres-0/list_functions.bash b/paludis/repositories/e/ebuild/exheres-0/list_functions.bash
index dfc324f7b..3519b5c18 100644
--- a/paludis/repositories/e/ebuild/exheres-0/list_functions.bash
+++ b/paludis/repositories/e/ebuild/exheres-0/list_functions.bash
@@ -43,17 +43,20 @@ optionfmt()
option()
{
+ [[ "${#@}" -gt 3 ]] && die "$0 takes at most three arguments"
optionq "${1}"
+ local r=$?
+ if [[ ${r} -eq 0 ]] ; then
+ [[ -n "${2}" ]] && echo "${2}"
+ else
+ [[ -n "${3}" ]] && echo "${3}"
+ fi
+ return ${r}
}
optionv()
{
- if optionq "${1}" ; then
- optionfmt "${1}"
- return 0
- else
- return 1
- fi
+ option "${1}" "$(optionfmt "${1}")"
}
optionq()