From d56a847392470609d4486cd7eac8772e4ce99c4b Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 08 2022 07:03:18 +0000 Subject: import environment-modules-4.5.2-2.el8 --- diff --git a/SOURCES/environment-modules-moulespath-initrc.patch b/SOURCES/environment-modules-moulespath-initrc.patch new file mode 100644 index 0000000..e88b820 --- /dev/null +++ b/SOURCES/environment-modules-moulespath-initrc.patch @@ -0,0 +1,44 @@ +diff --git a/modules-4.5.2/modulecmd.tcl.in b/modulecmd.tcl.in +index 3abd4ad..cf6cb3b 100644 +--- a/modules-4.5.2/modulecmd.tcl.in ++++ b/modulecmd.tcl.in +@@ -10564,8 +10564,17 @@ proc cmdModuleAutoinit {} { + @VERSIONING@ setenv MODULE_VERSION_STACK @MODULES_RELEASE@@MODULES_BUILD@ + @VERSIONING@} + +- # initialize default MODULEPATH and LOADEDMODULES +- if {![info exists ::env(MODULEPATH)] || $::env(MODULEPATH) eq {}} { ++ # initialize MODULEPATH and LOADEDMODULES if found unset ++ if {![info exists ::env(MODULEPATH)]} { ++ setenv MODULEPATH {} ++ } ++ if {![info exists ::env(LOADEDMODULES)]} { ++ setenv LOADEDMODULES {} ++ } ++ ++ # initialize user environment if found undefined (both MODULEPATH and ++ # LOADEDMODULES empty) ++ if {$::env(MODULEPATH) eq {} && $::env(LOADEDMODULES) eq {}} { + # set modpaths defined in modulespath config file if it exists, use file + # in etcdir if it exists, dot file in initdir elsewhere + set modulespath [expr {[file exists @etcdir@/modulespath] ?\ +@@ -10580,17 +10589,8 @@ proc cmdModuleAutoinit {} { + } + } + +- if {![info exists ::env(MODULEPATH)]} { +- setenv MODULEPATH {} +- } +- } +- if {![info exists ::env(LOADEDMODULES)]} { +- setenv LOADEDMODULES {} +- } +- +- # source initialization modulerc if any and if no env already initialized +- # use initrc file in etcdir if any, modulerc file in initdir otherwise +- if {$::env(MODULEPATH) eq {} && $::env(LOADEDMODULES) eq {}} { ++ # source initialization modulerc if any and if no env already initialized ++ # use initrc file in etcdir if any, modulerc file in initdir otherwise + set initrc [expr {[file exists @etcdir@/initrc] ? {@etcdir@/initrc} :\ + {@initdir@/modulerc}}] + if {[file exists $initrc]} { diff --git a/SPECS/environment-modules.spec b/SPECS/environment-modules.spec index c4a7911..f4d38d8 100644 --- a/SPECS/environment-modules.spec +++ b/SPECS/environment-modules.spec @@ -3,7 +3,7 @@ Name: environment-modules Version: 4.5.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Provides dynamic modification of a user's environment Group: System Environment/Base @@ -11,6 +11,7 @@ License: GPLv2+ URL: http://modules.sourceforge.net/ Source0: http://downloads.sourceforge.net/modules/modules-%{version}.tar.bz2 Patch0001: environment-modules-configure.patch +Patch0002: environment-modules-moulespath-initrc.patch BuildRequires: tcl-devel, libX11-devel BuildRequires: dejagnu, sed, procps, hostname, man, less @@ -57,8 +58,7 @@ This package provides Environment Modules compatibility version (3.2). %prep -%setup -q -n modules-%{version} -%patch0001 -p1 +%autosetup -n modules-%{version} %build @@ -191,6 +191,9 @@ fi %changelog +* Tue Jun 07 2022 Lukáš Zaoral - 4.5.2-2 +- Evaluate both modulespath and initrc during initialization (#1894870) + * Tue Aug 18 2020 Jan Synáček - 4.5.2-1 - Update to 4.5.2 (#1860674)