Package: environment-modules
Version: 3.2.10-9
Severity: normal
Dear Maintainer,
For bash completion, modulecmd is not at the path
/usr/share/modules/3.2.10/bin/modulecmd but in the normal /usr/bin/modulecmd.
The _module_avail function doesn't working so no completion for avail command.
The solution is to replace /usr/share/modules/3.2.10/bin/modulecmd by just
modulecmd because normally, /usr/bin is always in the PATH variable.
*** Reporter, please consider answering these questions, where appropriate ***
* What led up to the situation?
* What exactly did you do (or not do) that was effective (or
ineffective)?
* What was the outcome of this action?
* What outcome did you expect instead?
*** End of the template - remove these template lines ***
-- System Information:
Debian Release: 8.0
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.16.0-4-amd64 (SMP w/8 CPU cores)
Locale: LANG=fr_FR.UTF-8@euro, LC_CTYPE=fr_FR.UTF-8@euro (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages environment-modules depends on:
ii debhelper 9.20150101
ii libc6 2.19-18
ii libtcl8.6 8.6.2+dfsg-2
ii libx11-6 2:1.6.2-3
ii tcl 8.6.0+8
ii tcl8.6 8.6.2+dfsg-2
environment-modules recommends no packages.
environment-modules suggests no packages.
-- Configuration Files:
/etc/bash_completion.d/modules changed:
_module_avail() {
modulecmd bash -t avail 2>&1 | sed '
/:$/d;
/:ERROR:/d;
s#^\(.*\)/\(.\+\)(default)#\1\n\1\/\2#;
s#/(default)##g;
s#/*$##g;'
}
_module_not_yet_loaded() {
comm -23 <(_module_avail|sort) <(tr : '\n' <<<${LOADEDMODULES}|sort)
}
_module_long_arg_list() {
local cur="$1" i
if [[ ${COMP_WORDS[COMP_CWORD-2]} == sw* ]]
then
COMPREPLY=( $(compgen -W "$(_module_not_yet_loaded)" -- "$cur")
)
return
fi
for ((i = COMP_CWORD - 1; i > 0; i--))
do case ${COMP_WORDS[$i]} in
add|load)
COMPREPLY=( $(compgen -W "$(_module_not_yet_loaded)" -- "$cur")
)
break;;
rm|remove|unload|switch|swap)
COMPREPLY=( $(IFS=: compgen -W "${LOADEDMODULES}" -- "$cur") )
break;;
esac
done
}
_module() {
local cur="$2" prev="$3" cmds opts
COMPREPLY=()
cmds="add apropos avail clear display help\
initadd initclear initlist initprepend initrm initswitch\
keyword list load purge refresh rm show swap switch\
unload unuse update use whatis"
opts="-c -f -h -i -l -s -t -u -v -H -V\
--create --force --help --human --icase\
--long --silent --terse --userlvl --verbose --version"
case "$prev" in
add|load) COMPREPLY=( $(compgen -W "$(_module_not_yet_loaded)" --
"$cur") );;
rm|remove|unload|switch|swap)
COMPREPLY=( $(IFS=: compgen -W "${LOADEDMODULES}" --
"$cur") );;
unuse) COMPREPLY=( $(IFS=: compgen -W "${MODULEPATH}" --
"$cur") );;
use|*-a*) ;; # let readline handle the
completion
-u|--userlvl) COMPREPLY=( $(compgen -W "novice expert advanced" --
"$cur") );;
display|help|show|whatis)
COMPREPLY=( $(compgen -W "$(_module_avail)" -- "$cur")
);;
*) if test $COMP_CWORD -gt 2
then
_module_long_arg_list "$cur"
else
case "$cur" in
# The mappings below are optional abbreviations for convenience
ls) COMPREPLY="list";; # map ls -> list
r*) COMPREPLY="rm";; # also covers 'remove'
sw*) COMPREPLY="switch";;
-*) COMPREPLY=( $(compgen -W "$opts" -- "$cur") );;
*) COMPREPLY=( $(compgen -W "$cmds" -- "$cur") );;
esac
fi;;
esac
}
complete -o default -F _module module
/etc/environment-modules/modulespath changed:
/etc/environment-modules/modules
/usr/share/modules/versions # location of version
files
/usr/Modules/$MODULE_VERSION/modulefiles # Module pkg modulefiles (if
versioning)
/usr/share/modules/modulefiles # General module files
-- no debconf information
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]