diff options
author | Dave Reisner <d@falconindy.com> | 2011-06-07 02:02:32 +0200 |
---|---|---|
committer | Dave Reisner <d@falconindy.com> | 2011-06-19 23:33:34 +0200 |
commit | 7592c32bda5dc3bc45a98b1ddd91be52963b5be2 (patch) | |
tree | e21fce73e0f6da5be4391fd91d2f766f0d3a1650 /functions | |
parent | f2988f2bea65e345fd58e0e413b9eef4359d196b (diff) | |
download | mkinitcpio-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-- | functions | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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" |