1 |
commit: 759fb65536efbd7efd171d0fb8e461d192b5c0d9 |
2 |
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Aug 28 12:53:42 2014 +0000 |
4 |
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Aug 28 12:53:42 2014 +0000 |
6 |
URL: http://sources.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=759fb655 |
7 |
|
8 |
Remove redundant $@ in "for" loops throughout. |
9 |
|
10 |
* libs/core.bash.in (inherit): |
11 |
* libs/tests.bash.in (has): |
12 |
* modules/config.eselect (generic_handle_one_file, accept_handler) |
13 |
(merge_handler, display_handler): |
14 |
* modules/news.eselect (find_items, do_list, do_read, do_unread): |
15 |
* modules/rc.eselect (run_runscript, do_show): Remove redundant $@ |
16 |
in "for" loops throughout. |
17 |
|
18 |
--- |
19 |
ChangeLog | 10 ++++++++++ |
20 |
libs/core.bash.in | 2 +- |
21 |
libs/tests.bash.in | 2 +- |
22 |
modules/config.eselect | 8 ++++---- |
23 |
modules/news.eselect | 8 ++++---- |
24 |
modules/rc.eselect | 4 ++-- |
25 |
6 files changed, 22 insertions(+), 12 deletions(-) |
26 |
|
27 |
diff --git a/ChangeLog b/ChangeLog |
28 |
index 1f01c16..92d7730 100644 |
29 |
--- a/ChangeLog |
30 |
+++ b/ChangeLog |
31 |
@@ -1,3 +1,13 @@ |
32 |
+2014-08-28 Ulrich Müller <ulm@g.o> |
33 |
+ |
34 |
+ * libs/core.bash.in (inherit): |
35 |
+ * libs/tests.bash.in (has): |
36 |
+ * modules/config.eselect (generic_handle_one_file, accept_handler) |
37 |
+ (merge_handler, display_handler): |
38 |
+ * modules/news.eselect (find_items, do_list, do_read, do_unread): |
39 |
+ * modules/rc.eselect (run_runscript, do_show): Remove redundant $@ |
40 |
+ in "for" loops throughout. |
41 |
+ |
42 |
2014-06-05 Ulrich Müller <ulm@g.o> |
43 |
|
44 |
* misc/eselect.bashcomp (_eselect): Improve handling of options |
45 |
|
46 |
diff --git a/libs/core.bash.in b/libs/core.bash.in |
47 |
index 1384188..cc263b8 100644 |
48 |
--- a/libs/core.bash.in |
49 |
+++ b/libs/core.bash.in |
50 |
@@ -111,7 +111,7 @@ do_action() { |
51 |
# Sources a given eselect library file |
52 |
inherit() { |
53 |
local x |
54 |
- for x in "$@"; do |
55 |
+ for x; do |
56 |
[[ -e ${ESELECT_CORE_PATH}/${x}.bash ]] \ |
57 |
|| die "Couldn't find ${x}.bash" |
58 |
source "${ESELECT_CORE_PATH}/${x}.bash" \ |
59 |
|
60 |
diff --git a/libs/tests.bash.in b/libs/tests.bash.in |
61 |
index eeafc94..8fb8559 100644 |
62 |
--- a/libs/tests.bash.in |
63 |
+++ b/libs/tests.bash.in |
64 |
@@ -20,7 +20,7 @@ |
65 |
has() { |
66 |
local test=${1} item |
67 |
shift |
68 |
- for item in "$@" ; do |
69 |
+ for item; do |
70 |
[[ ${item} == ${test} ]] && return 0 |
71 |
done |
72 |
return 1 |
73 |
|
74 |
diff --git a/modules/config.eselect b/modules/config.eselect |
75 |
index dfa3826..7383b2f 100644 |
76 |
--- a/modules/config.eselect |
77 |
+++ b/modules/config.eselect |
78 |
@@ -62,7 +62,7 @@ generic_handle_one_file() { |
79 |
local file_raw file |
80 |
|
81 |
# for each parameter... |
82 |
- for file_raw in "$@" ; do |
83 |
+ for file_raw; do |
84 |
[[ -z ${file_raw} ]] && continue |
85 |
|
86 |
# do we have a number or a name? |
87 |
@@ -162,7 +162,7 @@ do_accept() { |
88 |
|
89 |
accept_handler() { |
90 |
local file |
91 |
- for file in "$@" ; do |
92 |
+ for file; do |
93 |
local sfile="${file}" dfile="${file/._cfg????_}" |
94 |
echo "Replacing ${dfile} with ${sfile}..." |
95 |
mv --interactive "${sfile}" "${dfile}" |
96 |
@@ -201,7 +201,7 @@ do_merge() { |
97 |
|
98 |
merge_handler() { |
99 |
local file |
100 |
- for file in "$@" ; do |
101 |
+ for file; do |
102 |
local sfile="${file}" dfile="${file/._cfg????_}" |
103 |
echo "Merging ${dfile} with ${sfile}..." |
104 |
merge_prog ${dfile} ${sfile} |
105 |
@@ -242,7 +242,7 @@ do_display() { |
106 |
|
107 |
display_handler() { |
108 |
local file |
109 |
- for file in "$@" ; do |
110 |
+ for file; do |
111 |
local sfile="${file}" dfile="${file/._cfg????_}" |
112 |
echo "Proposed changes to ${dfile}:" |
113 |
diff_prog -u ${dfile} ${sfile} |
114 |
|
115 |
diff --git a/modules/news.eselect b/modules/news.eselect |
116 |
index 782f81c..3cc1f84 100644 |
117 |
--- a/modules/news.eselect |
118 |
+++ b/modules/news.eselect |
119 |
@@ -15,7 +15,7 @@ NEWS_DIR="/var/lib/gentoo/news" |
120 |
# sort order: by item name (i.e. effectively by date) |
121 |
find_items() { |
122 |
local stat repos=$(get_repositories) repo file item |
123 |
- for stat in "$@"; do |
124 |
+ for stat; do |
125 |
for repo in ${repos}; do |
126 |
file="${EROOT}${NEWS_DIR}/news-${repo}.${stat}" |
127 |
[[ -f ${file} ]] || continue |
128 |
@@ -174,7 +174,7 @@ do_list() { |
129 |
|
130 |
set -- $(find_items unread read) |
131 |
write_list_start "News items:" |
132 |
- for item in "$@"; do |
133 |
+ for item; do |
134 |
stat=${item%%/*}; item=${item#*/} |
135 |
repo=${item%%/*}; item=${item#*/} |
136 |
find_repo_dir "${repo}" |
137 |
@@ -270,7 +270,7 @@ do_read() { |
138 |
&& echo "No news is good news." |
139 |
fi |
140 |
|
141 |
- for i in "$@"; do |
142 |
+ for i; do |
143 |
if ! is_number "${i}" || [[ ${i} -lt 1 || ${i} -gt ${#items[@]} ]] |
144 |
then |
145 |
write_warning_msg "Bad item number: ${i}" |
146 |
@@ -378,7 +378,7 @@ do_unread() { |
147 |
set -- ${seq} |
148 |
fi |
149 |
|
150 |
- for i in "$@"; do |
151 |
+ for i; do |
152 |
if ! is_number "${i}" || [[ ${i} -lt 1 || ${i} -gt ${#items[@]} ]] |
153 |
then |
154 |
write_warning_msg "Bad item number: ${i}" |
155 |
|
156 |
diff --git a/modules/rc.eselect b/modules/rc.eselect |
157 |
index f02abf7..6e1d3e5 100644 |
158 |
--- a/modules/rc.eselect |
159 |
+++ b/modules/rc.eselect |
160 |
@@ -90,7 +90,7 @@ show_script_status() { |
161 |
run_runscript() { |
162 |
local command=${1} |
163 |
shift |
164 |
- for script in "$@"; do |
165 |
+ for script; do |
166 |
is_script "${EROOT}/etc/init.d/${script}" \ |
167 |
&& /sbin/runscript "${EROOT}/etc/init.d/${script}" "${command}" |
168 |
done |
169 |
@@ -250,7 +250,7 @@ do_show() { |
170 |
fi |
171 |
fi |
172 |
|
173 |
- for runlevel in "$@"; do |
174 |
+ for runlevel; do |
175 |
[[ -n ${runlevel} && -d ${EROOT}/etc/runlevels/${runlevel} ]] \ |
176 |
|| die -q "\"${runlevel}\" is no valid runlevel" |