From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 4EDC21382C5 for ; Wed, 7 Feb 2018 05:08:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 86525E0AD5; Wed, 7 Feb 2018 05:08:11 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 63029E0AD5 for ; Wed, 7 Feb 2018 05:08:11 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D0EC7335C07 for ; Wed, 7 Feb 2018 05:08:09 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 63A691DB for ; Wed, 7 Feb 2018 05:08:08 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1517979948.e42e9b61024d752a3dfb56ab8e8ea6936333ec58.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/phase-helpers.sh X-VCS-Directories: bin/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: e42e9b61024d752a3dfb56ab8e8ea6936333ec58 X-VCS-Branch: master Date: Wed, 7 Feb 2018 05:08:08 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 713a5496-7f8d-43b0-8269-8bddec8670bd X-Archives-Hash: 42476b2503e928d04474d54437c7701c commit: e42e9b61024d752a3dfb56ab8e8ea6936333ec58 Author: Zac Medico gentoo org> AuthorDate: Wed Feb 7 05:05:48 2018 +0000 Commit: Zac Medico gentoo org> CommitDate: Wed Feb 7 05:05:48 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=e42e9b61 phase-helpers.sh: optimize array length tests Reported-by: R0b0t1 gmail.com> bin/phase-helpers.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh index 23cf80b39..49dad234d 100644 --- a/bin/phase-helpers.sh +++ b/bin/phase-helpers.sh @@ -810,7 +810,7 @@ __eapi4_src_install() { __eapi6_src_prepare() { if [[ $(declare -p PATCHES 2>/dev/null) == "declare -a"* ]]; then - [[ -n ${PATCHES[@]} ]] && eapply "${PATCHES[@]}" + [[ ${#PATCHES[@]} -gt 0 ]] && eapply "${PATCHES[@]}" elif [[ -n ${PATCHES} ]]; then eapply ${PATCHES} fi @@ -965,7 +965,7 @@ if ___eapi_has_einstalldocs; then [[ -f ${d} && -s ${d} ]] && docinto / && dodoc "${d}" done elif [[ $(declare -p DOCS) == "declare -a"* ]] ; then - [[ ${DOCS[@]} ]] && docinto / && dodoc -r "${DOCS[@]}" + [[ ${#DOCS[@]} -gt 0 ]] && docinto / && dodoc -r "${DOCS[@]}" else [[ ${DOCS} ]] && docinto / && dodoc -r ${DOCS} fi @@ -973,7 +973,7 @@ if ___eapi_has_einstalldocs; then ( if [[ $(declare -p HTML_DOCS 2>/dev/null) == "declare -a"* ]] ; then - [[ ${HTML_DOCS[@]} ]] && \ + [[ ${#HTML_DOCS[@]} -gt 0 ]] && \ docinto html && dodoc -r "${HTML_DOCS[@]}" else [[ ${HTML_DOCS} ]] && \ @@ -1040,7 +1040,7 @@ if ___eapi_has_eapply; then done fi - if [[ -z ${files[@]} ]]; then + if [[ ${#files[@]} -eq 0 ]]; then die "eapply: no files specified" fi @@ -1062,7 +1062,7 @@ if ___eapi_has_eapply; then local files=() _eapply_get_files "${f}" - [[ -z ${files[@]} ]] && die "No *.{patch,diff} files in directory ${f}" + [[ ${#files[@]} -eq 0 ]] && die "No *.{patch,diff} files in directory ${f}" einfo "Applying patches from ${f} ..." local f2