summaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-10-06 16:25:18 +0200
committerDave Reisner <dreisner@archlinux.org>2012-10-21 21:25:46 +0200
commit7b3890b0ec079b57a610147b18404444ff4c0190 (patch)
tree1759ac0fda1471e8b2f9ceb77b6289ab2845496f /functions
parent2d8c7e66ae8db2eb8b7549d441669e3b26695198 (diff)
downloadmkinitcpio-7b3890b0ec079b57a610147b18404444ff4c0190.tar.gz
mkinitcpio-7b3890b0ec079b57a610147b18404444ff4c0190.tar.xz
convert autodetect cache to hash
If mkinitcpio -s is run, we still flush this cache to disk before exiting. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Diffstat (limited to 'functions')
-rw-r--r--functions8
1 files changed, 4 insertions, 4 deletions
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 "$@"