aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkewl fft <kewl@alto.eu.org>2018-05-26 07:05:59 +0100
committerZac Medico <zmedico@gentoo.org>2018-05-25 23:29:21 -0700
commita468a995ba3e5931971804bdda485a88e68b0e18 (patch)
treebb0e6fc47e1113d87acea8972c99b00155437d00
parentprepare_build_dirs: convert PermissionError to PermissionDenied (bug 656542) (diff)
downloadportage-a468a995ba3e5931971804bdda485a88e68b0e18.tar.gz
portage-a468a995ba3e5931971804bdda485a88e68b0e18.tar.bz2
portage-a468a995ba3e5931971804bdda485a88e68b0e18.zip
etc-update: consistently use double bracket operator
Closes: https://github.com/gentoo/portage/pull/323
-rwxr-xr-xbin/etc-update16
1 files 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