modulecmd: init of manpath is now a sub-function of pmodules_init()

This commit is contained in:
2022-10-21 14:15:32 +02:00
parent e9bf48c1bf
commit fc20878cc9
+19 -19
View File
@@ -1817,25 +1817,6 @@ init_modulepath() {
done
}
init_manpath() {
std::replace_path MANPATH "${PMODULES_HOME%/*}/.*"
if [[ -r /etc/man.config ]]; then
declare _manconf='/etc/man.config'
elif [[ -r /etc/man.conf ]]; then
declare _manconf='/etc/man.conf'
fi
if [[ -n ${_manconf} ]]; then
while read name value rest; do
std::append_path MANPATH "${value}"
done < <(grep "^MANPATH\s" "${_manconf}")
unset _manconf
else
std::append_path MANPATH "${PMODULES_HOME}/share/man"
std::append_path MANPATH "/usr/share/man"
fi
}
pmodules_init() {
init_used_groups() {
declare -gx UsedGroups=''
@@ -1857,6 +1838,25 @@ pmodules_init() {
OverlayInfo['base:used']='yes'
}
init_manpath() {
std::replace_path MANPATH "${PMODULES_HOME%/*}/.*"
if [[ -r /etc/man.config ]]; then
declare _manconf='/etc/man.config'
elif [[ -r /etc/man.conf ]]; then
declare _manconf='/etc/man.conf'
fi
if [[ -n ${_manconf} ]]; then
while read name value rest; do
std::append_path MANPATH "${value}"
done < <(grep "^MANPATH\s" "${_manconf}")
unset _manconf
else
std::append_path MANPATH "${PMODULES_HOME}/share/man"
std::append_path MANPATH "/usr/share/man"
fi
}
pm::read_config
declare -gx LOADEDMODULES=''