commit: bde2bd3191812eddac0fab246d85bbb3e75e2a2c
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 1 07:39:35 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Mon Dec 1 07:48:36 2014 +0000
URL:
http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=bde2bd31
_gentoo_packages: more stylistic consistency
Generally we keep lvalues and rvalues in consistent positions in
conditional checks even though they can be swapped around there.
---
src/_gentoo_packages | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/_gentoo_packages b/src/_gentoo_packages
index a8a3aff..2bfa8c4 100644
--- a/src/_gentoo_packages
+++ b/src/_gentoo_packages
@@ -11,7 +11,7 @@ _portdir() {
local mainreponame mainrepopath overlayname overlaypath
if [[ -e /usr/share/portage/config/repos.conf ]]; then
- if [[ ${1} == -o ]]; then
+ if [[ ${1} == "-o" ]]; then
for overlayname in $(_parsereposconf -l); do
overlaypath+=($(_parsereposconf ${overlayname} location))
done
@@ -33,7 +33,7 @@ _portdir() {
source /etc/make.conf 2>/dev/null
source /etc/portage/make.conf 2>/dev/null
- if [[ "-o" == ${1} ]]; then
+ if [[ ${1} == "-o" ]]; then
echo "${(@u)PORTDIR_OVERLAY}"
else
echo "${PORTDIR}"
@@ -76,7 +76,7 @@ _parsereposconf() {
done < ${f}
done
- if [[ "-l" == ${1} ]]; then
+ if [[ ${1} == "-l" ]]; then
echo "${(@)secname}"
else
echo "${v}"
@@ -110,13 +110,13 @@ _parsesetsconf() {
arr[${name}]=${value}
if [[ ${insection} == 1 && ${name} == "section" ]]; then
- [[ "sets" == ${2} ]] && [[ ! ${value} =~ "sets" ]] &&
sections+=(${value})
+ [[ ${2} == "sets" ]] && [[ ! ${value} =~ "sets" ]] &&
sections+=(${value})
insection=0
elif [[ ${name} == "section" ]]; then
[[ ${value} =~ "${1:t} sets" ]] && insection=1
- [[ "sets" == ${2} ]] && [[ ! ${value} =~ "sets" ]] &&
sections+=(${value})
+ [[ ${2} == "sets" ]] && [[ ! ${value} =~ "sets" ]] &&
sections+=(${value})
elif [[ ${insection} == 1 ]]; then
- [[ "sets" == ${2} ]] && continue
+ [[ ${2} == "sets" ]] && continue
if [[ ${name} == "directory" ]]; then
v=${value}
fi
@@ -126,7 +126,7 @@ _parsesetsconf() {
fi
done
- if [[ "sets" == ${2} ]]; then
+ if [[ ${2} == "sets" ]]; then
[[ ((${#sections} > 0)) ]] && echo ${(@)sections}
else
[[ ((${#v} > 0)) ]] && echo ${v:t}