teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone
Blob Blame History Raw
From 7f10373aa0b75725edb66917fc31a17c65750a7c Mon Sep 17 00:00:00 2001
From: Tom Gundersen <teg@jklm.no>
Date: Thu, 6 Feb 2014 18:15:47 +0100
Subject: [PATCH] zsh-completions: kernel-install - only show existing kernels
 for 'remove'

When we remove a kernel, we don't remove the modules, so don't look at the modules directory to find installed kernels.
---
 shell-completion/zsh/_kernel-install | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/shell-completion/zsh/_kernel-install b/shell-completion/zsh/_kernel-install
index 0655188..4fdd3a4 100644
--- a/shell-completion/zsh/_kernel-install
+++ b/shell-completion/zsh/_kernel-install
@@ -12,7 +12,7 @@ _kernels(){
     read _MACHINE_ID < /etc/machine-id
     _kernel=( /lib/modules/[0-9]* )
     if [[ "$cmd" == "remove" && -n "$_MACHINE_ID" ]]; then
-        _kernel=( /lib/modules/[0-9]* "/boot/$_MACHINE_ID"/[0-9]* )
+        _kernel=( "/boot/$_MACHINE_ID"/[0-9]* )
     fi
     _kernel=( ${_kernel##*/} )
     _describe "installed kernels" _kernel