1 |
commit: bde2bd3191812eddac0fab246d85bbb3e75e2a2c |
2 |
Author: Tim Harder <radhermit <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Dec 1 07:39:35 2014 +0000 |
4 |
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Dec 1 07:48:36 2014 +0000 |
6 |
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=bde2bd31 |
7 |
|
8 |
_gentoo_packages: more stylistic consistency |
9 |
|
10 |
Generally we keep lvalues and rvalues in consistent positions in |
11 |
conditional checks even though they can be swapped around there. |
12 |
|
13 |
--- |
14 |
src/_gentoo_packages | 14 +++++++------- |
15 |
1 file changed, 7 insertions(+), 7 deletions(-) |
16 |
|
17 |
diff --git a/src/_gentoo_packages b/src/_gentoo_packages |
18 |
index a8a3aff..2bfa8c4 100644 |
19 |
--- a/src/_gentoo_packages |
20 |
+++ b/src/_gentoo_packages |
21 |
@@ -11,7 +11,7 @@ _portdir() { |
22 |
local mainreponame mainrepopath overlayname overlaypath |
23 |
|
24 |
if [[ -e /usr/share/portage/config/repos.conf ]]; then |
25 |
- if [[ ${1} == -o ]]; then |
26 |
+ if [[ ${1} == "-o" ]]; then |
27 |
for overlayname in $(_parsereposconf -l); do |
28 |
overlaypath+=($(_parsereposconf ${overlayname} location)) |
29 |
done |
30 |
@@ -33,7 +33,7 @@ _portdir() { |
31 |
source /etc/make.conf 2>/dev/null |
32 |
source /etc/portage/make.conf 2>/dev/null |
33 |
|
34 |
- if [[ "-o" == ${1} ]]; then |
35 |
+ if [[ ${1} == "-o" ]]; then |
36 |
echo "${(@u)PORTDIR_OVERLAY}" |
37 |
else |
38 |
echo "${PORTDIR}" |
39 |
@@ -76,7 +76,7 @@ _parsereposconf() { |
40 |
done < ${f} |
41 |
done |
42 |
|
43 |
- if [[ "-l" == ${1} ]]; then |
44 |
+ if [[ ${1} == "-l" ]]; then |
45 |
echo "${(@)secname}" |
46 |
else |
47 |
echo "${v}" |
48 |
@@ -110,13 +110,13 @@ _parsesetsconf() { |
49 |
arr[${name}]=${value} |
50 |
|
51 |
if [[ ${insection} == 1 && ${name} == "section" ]]; then |
52 |
- [[ "sets" == ${2} ]] && [[ ! ${value} =~ "sets" ]] && sections+=(${value}) |
53 |
+ [[ ${2} == "sets" ]] && [[ ! ${value} =~ "sets" ]] && sections+=(${value}) |
54 |
insection=0 |
55 |
elif [[ ${name} == "section" ]]; then |
56 |
[[ ${value} =~ "${1:t} sets" ]] && insection=1 |
57 |
- [[ "sets" == ${2} ]] && [[ ! ${value} =~ "sets" ]] && sections+=(${value}) |
58 |
+ [[ ${2} == "sets" ]] && [[ ! ${value} =~ "sets" ]] && sections+=(${value}) |
59 |
elif [[ ${insection} == 1 ]]; then |
60 |
- [[ "sets" == ${2} ]] && continue |
61 |
+ [[ ${2} == "sets" ]] && continue |
62 |
if [[ ${name} == "directory" ]]; then |
63 |
v=${value} |
64 |
fi |
65 |
@@ -126,7 +126,7 @@ _parsesetsconf() { |
66 |
fi |
67 |
done |
68 |
|
69 |
- if [[ "sets" == ${2} ]]; then |
70 |
+ if [[ ${2} == "sets" ]]; then |
71 |
[[ ((${#sections} > 0)) ]] && echo ${(@)sections} |
72 |
else |
73 |
[[ ((${#v} > 0)) ]] && echo ${v:t} |