diff options
author | 2012-09-05 21:49:31 +0200 | |
---|---|---|
committer | 2012-10-05 00:00:16 +0200 | |
commit | 36434f5612742c202692e46d0aa8c052a86456d1 (patch) | |
tree | 9ed6287dc38d50fb44bd6202fdd173b9cfc8891b | |
parent | 9eb9b77be17fee6069952a89308b14cc9f180d25 (diff) | |
download | paludis-36434f5612742c202692e46d0aa8c052a86456d1.tar.gz paludis-36434f5612742c202692e46d0aa8c052a86456d1.tar.xz |
exheres-0: Print extra args of 'option'
-rwxr-xr-x | paludis/repositories/e/ebuild/exheres-0/conditional_functions.bash | 12 | ||||
-rw-r--r-- | paludis/repositories/e/ebuild/exheres-0/list_functions.bash | 15 |
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() |