aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Quentin Glidic <sardemff7+git@sardemff7.net> 2012-09-05 21:49:31 +0200
committerAvatar Bo ├śrsted Andresen <bo.andresen@zlin.dk> 2012-10-05 00:00:16 +0200
commit36434f5612742c202692e46d0aa8c052a86456d1 (patch)
tree9ed6287dc38d50fb44bd6202fdd173b9cfc8891b
parent9eb9b77be17fee6069952a89308b14cc9f180d25 (diff)
downloadpaludis-36434f5612742c202692e46d0aa8c052a86456d1.tar.gz
paludis-36434f5612742c202692e46d0aa8c052a86456d1.tar.xz
exheres-0: Print extra args of 'option'
-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 4f6642f..1795cab 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 dfc324f..3519b5c 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()