quelques corrections

This commit is contained in:
Jephté Clain 2015-03-23 05:20:27 +04:00
parent 9182dcf5ca
commit ffaed8a1d2
2 changed files with 11 additions and 2 deletions

2
.udir
View File

@ -18,7 +18,7 @@ kvm_service=
openvz_service=
configure_variables=(dest uninst_utools rm_utools kvm_service openvz_service)
configure_dest_for=(bashrc profile lib/uinst/conf lib/uinst/rootconf lib/profile.d/nutools lib/bashrc.d/bash_completion.nutools lib/init.d/kvm-stop-all legacy/sysinc/utools legacy/sysinc/system_caps legacy/sysinc/private/init)
configure_dest_for=(bashrc profile lib/uinst/conf lib/uinst/rootconf lib/profile.d/nutools lib/bashrc.d/bash_completion lib/init.d/kvm-stop-all legacy/sysinc/utools legacy/sysinc/system_caps legacy/sysinc/private/init)
config_scripts=(lib/uinst/conf lib/uinst/system_caps.legacy)
install_profiles=true
profiledir=lib/profile.d

View File

@ -14,7 +14,16 @@ function __bash_completion_enabled() {
return 1
}
function __bash_completion_module_enabled() {
[ -f "/usr/share/bash-completion/completions/$1" ] && return 0
if [ -f "/usr/share/bash-completion/completions/$1" ]; then
local var="__NUTOOLS_BASH_COMPLETION_${1//-/_}"
if [ -z "${!var}" ]; then
# nous ne supportons pas le chargement à la demande: charger le
# module de suite
source "/usr/share/bash-completion/completions/$1"
eval "$var=1"
fi
return 0
fi
[ -n "$BASH_COMPLETION_COMPAT_DIR" -a -f "$BASH_COMPLETION_COMPAT_DIR/$1" ] && return 0
return 1
}