mirror of
https://github.com/envmodules/modules.git
synced 2026-06-10 00:56:30 +08:00
Update initialization, profile and completion scripts to enclose all references to the installation paths. Enclosing modulecmd.tcl installation path this way is not effective with the quarantine mechanism that implies a double shell code evaluation. So it is advised not to install Modules in a path containing a whitespace character if the quarantine mechanism is needed.
29 lines
876 B
Perl
29 lines
876 B
Perl
# define modules runtime quarantine configuration
|
|
@setquarvars@$ENV{'MODULES_RUN_QUARANTINE'} = '@RUN_QUARANTINE@';
|
|
@setquarvars@@$ENV{'RUNENV_VAR'} = 'RUNENV_VAL';@
|
|
@notsetquarvars@#$ENV{'MODULES_RUN_QUARANTINE'} = 'ENVVARNAME';
|
|
@notsetquarvars@
|
|
# setup quarantine if defined
|
|
my $_mlre = '';
|
|
if (defined $ENV{'MODULES_RUN_QUARANTINE'}) {
|
|
foreach my $_mlv (split(' ', $ENV{'MODULES_RUN_QUARANTINE'})) {
|
|
if ($_mlv =~ /^[A-Za-z_][A-Za-z0-9_]*$/) {
|
|
if (defined $ENV{$_mlv}) {
|
|
$_mlre .= "__MODULES_QUAR_${_mlv}='$ENV{$_mlv}' ";
|
|
}
|
|
my $_mlrv = "MODULES_RUNENV_$_mlv";
|
|
$_mlre .= "$_mlv='$ENV{$_mlrv}' ";
|
|
}
|
|
}
|
|
if ($_mlre ne "") {
|
|
$_mlre = "env ${_mlre}__MODULES_QUARANTINE_SET=1 ";
|
|
}
|
|
}
|
|
|
|
eval `${_mlre}@TCLSH@ '@libexecdir@/modulecmd.tcl' perl autoinit`;
|
|
|
|
# clean temp variable used to setup quarantine
|
|
undef $_mlre;
|
|
|
|
1;
|