From 7b3890b0ec079b57a610147b18404444ff4c0190 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sat, 6 Oct 2012 10:25:18 -0400 Subject: convert autodetect cache to hash If mkinitcpio -s is run, we still flush this cache to disk before exiting. Signed-off-by: Dave Reisner --- functions | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'functions') diff --git a/functions b/functions index d077213..cc4509a 100644 --- a/functions +++ b/functions @@ -273,8 +273,8 @@ add_checked_modules() { local mod mods - if [[ -s $_f_autodetect_cache ]]; then - mapfile -t mods < <(all_modules "$@" | grep -xFf "$_f_autodetect_cache") + if (( ${#_autodetect_cache[*]} )); then + mapfile -t mods < <(all_modules "$@" | grep -xFf <(printf '%s\n' "${!_autodetect_cache[@]}")) else mapfile -t mods < <(all_modules "$@") fi @@ -293,8 +293,8 @@ checked_modules() { # DEPRECATED: Use add_checked_modules instead # - if [[ -s $_f_autodetect_cache ]]; then - grep -xFf "$_f_autodetect_cache" <(all_modules "$@") + if (( ${#_autodetect_cache[*]} )); then + all_modules "$@" | grep -xFf <(printf '%s\n' "${!_autodetect_cache[@]}") return 1 else all_modules "$@" -- cgit v1.2.3-24-g4f1b