-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
skip initialization of user .modulerc #479
Comments
Such feature does not exist at the moment. Best you can do is to redefine the proc runModulerc {} {
set rclist {}
if {[set rcfile [getConf rcfile]] ne {}} {
# if MODULERCFILE is a dir, look at a modulerc file in it
if {[file isdirectory $rcfile]\
&& [file isfile $rcfile/modulerc]} {
lappend rclist $rcfile/modulerc
} elseif {[file isfile $rcfile]} {
lappend rclist $rcfile
}
}
if {[file isfile @etcdir@/rc]} {
lappend rclist @etcdir@/rc
}
if {[ongoingCommandName] ne {autoinit}} {
if {[info exists ::env(HOME)] && [file isfile $::env(HOME)/.modulerc]} {
lappend rclist $::env(HOME)/.modulerc
}
}
setState rc_running 1
foreach rc $rclist {
if {[file readable $rc]} {
reportDebug "Executing $rc"
cmdModuleSource load $rc
lappendState rc_loaded $rc
}
}
unsetState rc_running
# identify alias or symbolic version set in these global RC files to be
# able to include them or not in output or resolution processes
array set ::g_rcAlias [array get ::g_moduleAlias]
array set ::g_rcVersion [array get ::g_moduleVersion]
array set ::g_rcVirtual [array get ::g_moduleVirtual]
} |
For next version, a feature can be added to skip user modulerc on commands listed in a configuration variable. |
Thanks @xdelaruelle , I don't want to drop all together, but no rush I'll wait for the next version,
so already initialized 'module' can skip the user .modulerc as well, this, as it's being called with every 'module' execution. To get you the idea for the motivation here, we have several OSs, Ubuntu, RHEL, SLES.. example: default PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/nas/bin $ cat /usr/nas/bin/lcov
The lcov modulefile in that example: $ cat /usr/nas/share/modulefiles/lcov/1.15
The end goal is that the module directive executable won't interpreted user .modulerc, |
Hi,
Is it possible to avoid sourcing user ~/.modulerc when initializing the module function?
maybe set some MODULE_SKIP_USER_MODULERC=1 or some equivalent
which will be taken care of during source "$ENV_MODULES_INSTALL_PATH/init/bash" ?
[ using version 5.1.1 ]
Thanks.
The text was updated successfully, but these errors were encountered: