summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2017-02-22 20:09:29 +0100
committerMichał Górny <mgorny@gentoo.org>2017-03-08 08:35:26 +0100
commit0a2371efbe94fb1b410c0afd49bb1bb640d36a9e (patch)
tree140a6cde98d17a6e1aeb612f857d87ebe634524f /eclass/cvs.eclass
parentapp-crypt/mit-krb5: version bump to 1.15.1 (diff)
downloadgentoo-0a2371efbe94fb1b410c0afd49bb1bb640d36a9e.tar.gz
gentoo-0a2371efbe94fb1b410c0afd49bb1bb640d36a9e.tar.bz2
gentoo-0a2371efbe94fb1b410c0afd49bb1bb640d36a9e.zip
cvs.eclass: Replace unnecessary eval with bash arrays
Replace the eval used to pass quoted password in with simpler and safer bash arrays. Using eval is strongly discouraged as it is error-prone and confusing.
Diffstat (limited to 'eclass/cvs.eclass')
-rw-r--r--eclass/cvs.eclass28
1 files changed, 14 insertions, 14 deletions
diff --git a/eclass/cvs.eclass b/eclass/cvs.eclass
index 6d1adea11a4c..e2121f4724f2 100644
--- a/eclass/cvs.eclass
+++ b/eclass/cvs.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: cvs.eclass
@@ -352,22 +352,22 @@ cvs_fetch() {
fi
# Commands to run
- cmdlogin="${run} ${ECVS_CVS_COMMAND} -d \"${cvsroot_pass}\" login"
- cmdupdate="${run} ${ECVS_CVS_COMMAND} -d \"${cvsroot_nopass}\" update ${ECVS_UP_OPTS} ${ECVS_LOCALNAME}"
- cmdcheckout="${run} ${ECVS_CVS_COMMAND} -d \"${cvsroot_nopass}\" checkout ${ECVS_CO_OPTS} ${ECVS_MODULE}"
+ cmdlogin=( ${run} ${ECVS_CVS_COMMAND} -d "${cvsroot_pass}" login )
+ cmdupdate=( ${run} ${ECVS_CVS_COMMAND} -d "${cvsroot_nopass}" update ${ECVS_UP_OPTS} ${ECVS_LOCALNAME} )
+ cmdcheckout=( ${run} ${ECVS_CVS_COMMAND} -d "${cvsroot_nopass}" checkout ${ECVS_CO_OPTS} ${ECVS_MODULE} )
# Execute commands
cd "${ECVS_TOP_DIR}"
if [[ ${ECVS_AUTH} == "pserver" ]] ; then
- einfo "Running ${cmdlogin}"
- eval ${cmdlogin} || die "cvs login command failed"
+ einfo "Running ${cmdlogin[*]}"
+ "${cmdlogin[@]}" || die "cvs login command failed"
if [[ ${mode} == "update" ]] ; then
- einfo "Running ${cmdupdate}"
- eval ${cmdupdate} || die "cvs update command failed"
+ einfo "Running ${cmdupdate[*]}"
+ "${cmdupdate[@]}" || die "cvs update command failed"
elif [[ ${mode} == "checkout" ]] ; then
- einfo "Running ${cmdcheckout}"
- eval ${cmdcheckout} || die "cvs checkout command failed"
+ einfo "Running ${cmdcheckout[*]}"
+ "${cmdcheckout[@]}" || die "cvs checkout command failed"
fi
elif [[ ${ECVS_AUTH} == "ext" || ${ECVS_AUTH} == "no" ]] ; then
# Hack to support SSH password authentication
@@ -461,11 +461,11 @@ EOF
fi
if [[ ${mode} == "update" ]] ; then
- einfo "Running ${cmdupdate}"
- eval ${cmdupdate} || die "cvs update command failed"
+ einfo "Running ${cmdupdate[*]}"
+ "${cmdupdate[@]}" || die "cvs update command failed"
elif [[ ${mode} == "checkout" ]] ; then
- einfo "Running ${cmdcheckout}"
- eval ${cmdcheckout} || die "cvs checkout command failed"
+ einfo "Running ${cmdcheckout[*]}"
+ "${cmdcheckout[@]}" || die "cvs checkout command failed"
fi
# Restore environment variable values