1 |
commit: fef6268f8d03e3ab3e2564cbf3634d0db2bcd99e |
2 |
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com> |
3 |
AuthorDate: Thu Aug 25 21:10:45 2016 +0000 |
4 |
Commit: William Hubbs <williamh <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Aug 25 21:12:33 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=fef6268f |
7 |
|
8 |
modules-load.d: cleanups |
9 |
|
10 |
Move list of directories to a local variable and create the fn variable |
11 |
to use for an individual file name rather than using path. |
12 |
|
13 |
init.d/modules-load.in | 13 ++++++------- |
14 |
1 file changed, 6 insertions(+), 7 deletions(-) |
15 |
|
16 |
diff --git a/init.d/modules-load.in b/init.d/modules-load.in |
17 |
index 8c19a36..0f80396 100644 |
18 |
--- a/init.d/modules-load.in |
19 |
+++ b/init.d/modules-load.in |
20 |
@@ -16,12 +16,11 @@ depend() |
21 |
keyword -docker -lxc -openvz -prefix -systemd-nspawn -vserver |
22 |
} |
23 |
|
24 |
-modules_dirs="/usr/lib/modules-load.d /run/modules-load.d /etc/modules-load.d" |
25 |
- |
26 |
find_modfiles() |
27 |
{ |
28 |
- local basenames files x y |
29 |
- for x in $modules_dirs; do |
30 |
+ local dirs="/usr/lib/modules-load.d /run/modules-load.d /etc/modules-load.d" |
31 |
+ local basenames files fn x y |
32 |
+ for x in $dirs; do |
33 |
[ ! -d $x ] && continue |
34 |
for y in $x/*.conf; do |
35 |
[ -f $y ] && basenames="${basenames}\n${y##*/}" |
36 |
@@ -29,11 +28,11 @@ find_modfiles() |
37 |
done |
38 |
basenames=$(printf "$basenames" | sort -u) |
39 |
for x in $basenames; do |
40 |
- for y in $modules_dirs; do |
41 |
+ for y in $dirs; do |
42 |
[ -r $y/$x ] && |
43 |
- path=$y/$x |
44 |
+ fn=$y/$x |
45 |
done |
46 |
- files="$files $path" |
47 |
+ files="$files $fn" |
48 |
done |
49 |
echo $files |
50 |
} |