Files
modules/init/ruby.rb.in
Xavier Delaruelle 5aaedd85ca init: enclose installation path references
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.
2022-06-16 18:57:30 +02:00

26 lines
991 B
Ruby

# 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
_mlre = ''
if ENV.has_key?('MODULES_RUN_QUARANTINE') then
ENV['MODULES_RUN_QUARANTINE'].split(' ').each do |_mlv|
if _mlv =~ /^[A-Za-z_][A-Za-z0-9_]*$/ then
if ENV.has_key?(_mlv) then
_mlre << "__MODULES_QUAR_" + _mlv + "='" + ENV[_mlv].to_s + "' "
end
_mlrv = 'MODULES_RUNENV_' + _mlv
_mlre << _mlv + "='" + ENV[_mlrv].to_s + "' "
end
end
unless _mlre.empty?
_mlre = 'env ' + _mlre + '__MODULES_QUARANTINE_SET=1 '
end
end
# define module command and surrounding initial environment (default value
# for MODULESHOME, MODULEPATH, LOADEDMODULES and parse of init config files)
eval `#{_mlre}@TCLSH@ '@libexecdir@/modulecmd.tcl' ruby autoinit`