Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH 2/3] Replace obsolate modprobe -l by file search



In the manual page of the current modprobe (version 3.4) the option -l is
marked as obsolate; âThis option is provided for backwards
compatibility.â So use Zsh tools to get the name of the modules. The base
directory is takes from the manual page that says: âmodprobe looks in
the module directory /lib/modules/âuname -râ for all the modules [â].â
---
 Completion/Linux/Command/_modutils |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Completion/Linux/Command/_modutils b/Completion/Linux/Command/_modutils
index db419ac..fe1b58e 100644
--- a/Completion/Linux/Command/_modutils
+++ b/Completion/Linux/Command/_modutils
@@ -77,7 +77,7 @@ case "$state" in
   ;&
 
   all_modules)
-    modules=( ${${${${(f)"$(_call_program modules ${(M)words[1]##*/}modprobe -l 2>/dev/null)"}:#}##*/}%%.*} )
+    modules=( /lib/modules/$(uname -r)/(*~source)/**/*(.:t:r) )
 
     if [[ $state = loadable_modules ]]; then
         modules=( ${modules:#(${(j:|:)~${=loaded_modules//_/-}})} )
-- 
1.6.0.6



Messages sorted by: Reverse Date, Date, Thread, Author