summaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2011-06-07 02:02:32 +0200
committerDave Reisner <d@falconindy.com>2011-06-19 23:33:34 +0200
commit7592c32bda5dc3bc45a98b1ddd91be52963b5be2 (patch)
treee21fce73e0f6da5be4391fd91d2f766f0d3a1650 /functions
parentf2988f2bea65e345fd58e0e413b9eef4359d196b (diff)
downloadmkinitcpio-7592c32bda5dc3bc45a98b1ddd91be52963b5be2.tar.gz
mkinitcpio-7592c32bda5dc3bc45a98b1ddd91be52963b5be2.tar.xz
mkinitcpio: bashification, part 1/2
Always use bash's [[ ]], and apply (( )) where arithmetic calculations are made. We also take a few other bash shortcuts to simplify code where possible. We also touch the Makefile here to adjust the sed'ing for directory names. Signed-off-by: Dave Reisner <d@falconindy.com>
Diffstat (limited to 'functions')
-rw-r--r--functions6
1 files changed, 3 insertions, 3 deletions
diff --git a/functions b/functions
index bd80eb2..a4f6c0c 100644
--- a/functions
+++ b/functions
@@ -188,8 +188,8 @@ add_module() {
local module path fw dep deps
module=${1%.ko*}
- #skip expensive stuff if this module has already been added
- in_array $module ${ADDED_MODULES[@]} && return
+ # skip expensive stuff if this module has already been added
+ in_array "${module//-/_}" "${ADDED_MODULES[@]}" && return
path=$(kmodinfo -0F filename "$module")
if [[ $path ]]; then
@@ -206,7 +206,7 @@ add_module() {
add_module "$dep"
done
- ADDED_MODULES+=("$module")
+ ADDED_MODULES+=("${module//-/_}")
add_file "$path" || return
else
error "module '$module' not found"