summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2013-02-28 18:38:24 +0100
committerDave Reisner <dreisner@archlinux.org>2013-02-28 18:38:24 +0100
commit07cf5a74aed190308f94eb76d9b1ad08492736a2 (patch)
treef2ab47f6f293f4ac8d8f358fb888ec6f643504c6
parent7dbb8b6407f803c87697680b5bea09b4ae2e02d5 (diff)
downloadmkinitcpio-07cf5a74aed190308f94eb76d9b1ad08492736a2.tar.gz
mkinitcpio-07cf5a74aed190308f94eb76d9b1ad08492736a2.tar.xz
bash-completion: use kernel versions from detection
Instead of rummaging through /lib for kernel versions, just use the validated versions from the hunt through /boot. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rw-r--r--bash-completion10
1 files changed, 2 insertions, 8 deletions
diff --git a/bash-completion b/bash-completion
index e7c1db0..a0f07dc 100644
--- a/bash-completion
+++ b/bash-completion
@@ -25,21 +25,15 @@ _lsinitcpio() {
_find_kernel_versions() {
local -a matches
- local dir f
+ local dir f kver
for f in /boot/*; do
# only match regular files which pass validation
if [[ ! -L $f && -f $f ]] && kver=$(_detect_kver "$f"); then
- matches+=("$f")
+ matches+=("$f" "$kver")
fi
done
- # add completions based on kernel versions in /lib/modules
- for dir in /lib/modules/*/kernel; do
- dir=${dir%/kernel}
- matches+=("${dir#/lib/modules/}")
- done
-
COMPREPLY=($(compgen -W "${matches[*]}" -- $cur))
}