From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 189221384B4 for ; Fri, 1 Jan 2016 16:49:02 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AA9C021C0FC; Fri, 1 Jan 2016 16:41:57 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C86F921C0F8 for ; Fri, 1 Jan 2016 16:41:56 +0000 (UTC) Received: from localhost.localdomain (d202-251.icpnet.pl [109.173.202.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id 02C01340A51; Fri, 1 Jan 2016 16:41:52 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH 13/15] scons-utils.eclass: _scons_clean_makeopts, clean up and simplify Date: Fri, 1 Jan 2016 17:41:19 +0100 Message-Id: <1451666481-22145-14-git-send-email-mgorny@gentoo.org> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1451666481-22145-1-git-send-email-mgorny@gentoo.org> References: <1451666481-22145-1-git-send-email-mgorny@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Archives-Salt: a10450ea-aec6-440d-90a4-0b8fd19ab681 X-Archives-Hash: a37ccacfb51a8d458718db288a580106 --- eclass/scons-utils.eclass | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/eclass/scons-utils.eclass b/eclass/scons-utils.eclass index 82e45e3..3185282 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 -- 2.6.4