Package: bash-completion 
Version: 1:2.0-1 

Problem: The modules completion is performed by this function 

_modules() 
{ 
local modpath 
modpath=/lib/modules/$1 
COMPREPLY=( $( compgen -W "$( command ls -RL $modpath 2>/dev/null | \ 
sed -ne 's/^\(.*\)\.k\{0,1\}o\(\.[gx]z\)\{0,1\}$/\1/p' )" -- "$cur" ) ) 
} 

Because the "-L" option, the command "ls" above follows symbolic links. 

For this reason, the completion of the commands "modinfo" and "modprobe" 
takes a really very long time when you have the symlinks "build" 
and "source" in $modpath. 

These symlinks are automatically added by the kernel's Debian package 
generated by make-kpkg. 


Fix: Just drop the "-L" option in the command "ls". 

Alternatively you can use something like 

find -P $modpath -type f -name '*.ko' 2>/dev/null | \ 
sed -e 's|.*/||g;s/[.]ko$//' 

Regards, 

Fernando Auil 



Reply via email to