diff options
author | Michał Górny <mgorny@gentoo.org> | 2016-01-01 14:03:19 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2016-01-08 06:14:36 +0100 |
commit | 35777b5d9a7ddcbcd8ff9b3b2008fce82501ae7c (patch) | |
tree | 68ea2e5b4a871cda02d29743b64727b633470e0a /eclass | |
parent | scons-utils.eclass: _scons_clean_makeopts, stop exporting cache vars (diff) | |
download | gentoo-35777b5d9a7ddcbcd8ff9b3b2008fce82501ae7c.tar.gz gentoo-35777b5d9a7ddcbcd8ff9b3b2008fce82501ae7c.tar.bz2 gentoo-35777b5d9a7ddcbcd8ff9b3b2008fce82501ae7c.zip |
scons-utils.eclass: _scons_clean_makeopts, clean up and simplify
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/scons-utils.eclass | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/eclass/scons-utils.eclass b/eclass/scons-utils.eclass index 82e45e3c080e..318528204729 100644 --- a/eclass/scons-utils.eclass +++ b/eclass/scons-utils.eclass @@ -158,7 +158,7 @@ escons() { # gets an argument. Output the resulting flag list (suitable # for an assignment to SCONSOPTS). _scons_clean_makeopts() { - local new_makeopts + local new_makeopts=() debug-print-function ${FUNCNAME} "${@}" @@ -183,16 +183,16 @@ _scons_clean_makeopts() { case ${1} in # clean, simple to check -- we like that --jobs=*|--keep-going) - new_makeopts=${new_makeopts+${new_makeopts} }${1} + new_makeopts+=( ${1} ) ;; # need to take a look at the next arg and guess --jobs) if [[ ${#} -gt 1 && ${2} =~ ^[0-9]+$ ]]; then - new_makeopts="${new_makeopts+${new_makeopts} }${1} ${2}" + new_makeopts+=( ${1} ${2} ) shift else # no value means no limit, let's pass a random int - new_makeopts=${new_makeopts+${new_makeopts} }${1}=5 + new_makeopts+=( ${1}=5 ) fi ;; # strip other long options @@ -207,20 +207,20 @@ _scons_clean_makeopts() { while [[ -n ${str} ]]; do case ${str} in k*) - new_optstr=${new_optstr}k + new_optstr+=k ;; # -j needs to come last j) if [[ ${#} -gt 1 && ${2} =~ ^[0-9]+$ ]]; then - new_optstr="${new_optstr}j ${2}" + new_optstr+="j ${2}" shift else - new_optstr="${new_optstr}j 5" + new_optstr+="j 5" fi ;; # otherwise, everything after -j is treated as an arg j*) - new_optstr=${new_optstr}${str} + new_optstr+=${str} break ;; esac @@ -228,17 +228,16 @@ _scons_clean_makeopts() { done if [[ -n ${new_optstr} ]]; then - new_makeopts=${new_makeopts+${new_makeopts} }-${new_optstr} + new_makeopts+=( -${new_optstr} ) fi ;; esac shift done - set -- ${new_makeopts} - _SCONS_CACHE_SCONSOPTS=${*} - debug-print "New SCONSOPTS: [${*}]" - SCONSOPTS=${*} + SCONSOPTS=${new_makeopts[*]} + _SCONS_CACHE_SCONSOPTS=${SCONSOPTS} + debug-print "New SCONSOPTS: [${SCONSOPTS}]" } # @FUNCTION: use_scons |