From 7592c32bda5dc3bc45a98b1ddd91be52963b5be2 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Mon, 6 Jun 2011 20:02:32 -0400 Subject: 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 --- functions | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'functions') 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" -- cgit v1.2.3-24-g4f1b