From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <gentoo-commits+bounces-1026114-garchives=archives.gentoo.org@lists.gentoo.org> 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 F2446138330 for <garchives@archives.gentoo.org>; Sat, 26 May 2018 06:36:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E0A4EE07DF; Sat, 26 May 2018 06:36:12 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 B9CDAE07DF for <gentoo-commits@lists.gentoo.org>; Sat, 26 May 2018 06:36:12 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 5C67C335C74 for <gentoo-commits@lists.gentoo.org>; Sat, 26 May 2018 06:36:11 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 89A8C2A9 for <gentoo-commits@lists.gentoo.org>; Sat, 26 May 2018 06:36:09 +0000 (UTC) From: "Zac Medico" <zmedico@gentoo.org> 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" <zmedico@gentoo.org> Message-ID: <1527316161.a468a995ba3e5931971804bdda485a88e68b0e18.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/etc-update X-VCS-Directories: bin/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: a468a995ba3e5931971804bdda485a88e68b0e18 X-VCS-Branch: master Date: Sat, 26 May 2018 06:36:09 +0000 (UTC) Precedence: bulk List-Post: <mailto:gentoo-commits@lists.gentoo.org> List-Help: <mailto:gentoo-commits+help@lists.gentoo.org> List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org> List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org> X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: c874e159-eb0f-4a97-8a40-700acddb22e1 X-Archives-Hash: 43635ea24512118396e14ccf6acaf8e1 commit: a468a995ba3e5931971804bdda485a88e68b0e18 Author: kewl fft <kewl <AT> alto <DOT> eu <DOT> org> AuthorDate: Sat May 26 06:05:59 2018 +0000 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> CommitDate: Sat May 26 06:29:21 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=a468a995 etc-update: consistently use double bracket operator Closes: https://github.com/gentoo/portage/pull/323 bin/etc-update | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/etc-update b/bin/etc-update index 4f02876ef..afdd48ce8 100755 --- a/bin/etc-update +++ b/bin/etc-update @@ -146,8 +146,8 @@ scan() { find_opts+=( "$name_opt" ) find_opts+=( ! -name '.*~' ! -iname '.*.bak' -print ) - if [ ! -w "${path}" ] ; then - [ -e "${path}" ] || continue + if [[ ! -w ${path} ]] ; then + [[ -e ${path} ]] || continue die "Need write access to ${path}" fi @@ -383,7 +383,7 @@ read_int() { } do_file() { - interactive_echo() { [ "${OVERWRITE_ALL}" != "yes" ] && [ "${DELETE_ALL}" != "yes" ] && echo; } + interactive_echo() { [[ ${OVERWRITE_ALL} != yes ]] && [[ ${DELETE_ALL} != yes ]] && echo; } interactive_echo local -i my_input local -i linecnt @@ -541,17 +541,17 @@ do_cfg() { case ${my_input} in 1) echo "Replacing ${ofile} with ${file}" do_mv_ln ${mv_opts} "${file}" "${ofile}" - [ -n "${OVERWRITE_ALL}" ] && my_input=-1 + [[ -n ${OVERWRITE_ALL} ]] && my_input=-1 continue ;; 2) echo "Deleting ${file}" rm ${rm_opts} "${file}" - [ -n "${DELETE_ALL}" ] && my_input=-1 + [[ -n ${DELETE_ALL} ]] && my_input=-1 continue ;; 3) do_merge "${file}" "${ofile}" my_input=${?} -# [ ${my_input} == 255 ] && my_input=-1 +# [[ ${my_input} == 255 ]] && my_input=-1 continue ;; 4) continue @@ -696,10 +696,10 @@ die() { trap SIGINT local msg=$1 exitcode=${2:-1} - if [ ${exitcode} -eq 0 ] ; then + if [[ ${exitcode} -eq 0 ]] ; then ${QUIET} || printf 'Exiting: %b\n' "${msg}" scan > /dev/null - ! ${QUIET} && [ ${count} -gt 0 ] && echo "NOTE: ${count} updates remaining" + ! ${QUIET} && [[ ${count} -gt 0 ]] && echo "NOTE: ${count} updates remaining" else error "${msg}" fi