diff options
author | Dave Reisner <dreisner@archlinux.org> | 2012-10-06 16:25:18 +0200 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2012-10-21 21:25:46 +0200 |
commit | 7b3890b0ec079b57a610147b18404444ff4c0190 (patch) | |
tree | 1759ac0fda1471e8b2f9ceb77b6289ab2845496f /mkinitcpio | |
parent | 2d8c7e66ae8db2eb8b7549d441669e3b26695198 (diff) | |
download | mkinitcpio-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 'mkinitcpio')
-rwxr-xr-x | mkinitcpio | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -17,12 +17,12 @@ _d_install=(install /usr/lib/initcpio/install /lib/initcpio/install) _d_presets=mkinitcpio.d # options and runtime data -_optmoduleroot= _optkver= _f_autodetect_cache= _optgenimg= _optpreset= +_optmoduleroot= _optkver= _optgenimg= _optpreset= _optcompress= _optshowautomods=0 _optsavetree=0 _optshowmods=0 _optquiet=1 _optcolor=1 _optskiphooks=() _optaddhooks=() _modpaths=() _hooks=() -declare -A _runhooks=() _addedmodules=() +declare -A _runhooks=() _addedmodules=() _autodetect_cache=() # export a sane PATH export PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' @@ -64,6 +64,7 @@ cleanup() { if [[ $_d_workdir ]]; then # when _optpreset is set, we're in the main loop, not a worker process if (( _optsavetree )) && [[ -z $_optpreset ]]; then + printf '%s\n' "${!_autodetect_cache[@]}" > "$_d_workdir/autodetect_modules" msg "build directory saved in %s" "$_d_workdir" else rm -rf "$_d_workdir" @@ -378,7 +379,7 @@ if (( _optshowautomods )); then _f_autodetect_hook=$(find_in_dirs 'autodetect' "${_d_install[@]}") . "$_f_autodetect_hook" build - cat "$_f_autodetect_cache" + printf '%s\n' "${!_autodetect_cache[@]}" | sort cleanup 0 fi |