Compare commits

...

No commits in common. "c8" and "c9-beta" have entirely different histories.
c8 ... c9-beta

7 changed files with 157 additions and 229 deletions

View File

@ -1 +1 @@
a260805197fa5d5acd57f45505ded181025ead8e SOURCES/modules-4.5.2.tar.bz2
cb1def0bb726097edb5d077d59cf9272380243db SOURCES/modules-5.3.0.tar.bz2

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/modules-4.5.2.tar.bz2
SOURCES/modules-5.3.0.tar.bz2

View File

@ -1,17 +0,0 @@
Partially reverts https://github.com/cea-hpc/modules/commit/6a80cd9a460160fee96ed46b175b716989adbf27.
Fedora still uses rpm macros that add "--build=x86_64-redhat-linux-gnu" to the configure arguments
and since this configure is not a proper gnu one, it would always error out and never build.
See https://bugzilla.redhat.com/show_bug.cgi?id=1842562.
--- a/configure 2020-07-30 14:13:34.000000000 +0200
+++ b/configure 2020-08-03 16:06:37.137023909 +0200
@@ -598,8 +598,6 @@
--with-x|--without-x)
# pass argument supported by compat version to its ./configure script
compatarglist+="$arg " ;;
- *)
- echo_error "Unrecognized option \`$arg'" 1;;
esac
done

View File

@ -1,44 +0,0 @@
From 741f2e6b61b2c574e9c6972d3633653c26bb143a Mon Sep 17 00:00:00 2001
From: Xavier Delaruelle <xavier.delaruelle@cea.fr>
Date: Mon, 10 Aug 2020 19:22:46 +0200
Subject: [PATCH] Skip module switch conflict set if old matches new
`module switch` command used in modulefile is sometimes used to ensure a
given version of a module is loaded. Currently loaded version of this
module is unloaded to replace it by the designated specific version.
This use case does not cope with the conflict declaration that is set
over switched-off module specification. To support this use case,
conflict definition is skipped if swapped-off module specification
matches (includes) swapped-on module specification.
Fixes #355
---
modulecmd.tcl.in | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/modulecmd.tcl.in b/modulecmd.tcl.in
index 3abd4ad9a..8658b90bd 100644
--- a/modulecmd.tcl.in
+++ b/modulecmd.tcl.in
@@ -9482,11 +9482,16 @@ proc cmdModuleSwitch {uasked old {new {}}} {
# mentionned on this module switch command set in a modulefile
set orig_auto_handling [getConf auto_handling]
if {!$uasked && $argold ne {}} {
- # temporarily disable auto handling just to record deps, not to try to
- # load or unload them (already tried)
- setConf auto_handling 0
- catch {conflict $argold}
- setConf auto_handling $orig_auto_handling
+ # skip conflict declaration if old spec matches new as in this case
+ # switch means *replace loaded version of mod by this specific version*
+ lassign [getPathToModule $new] newmodfile newmod
+ if {$newmod eq {} || ![modEq $argold $newmod eqstart]} {
+ # temporarily disable auto handling just to record deps, not to try
+ # to load or unload them (already tried)
+ setConf auto_handling 0
+ catch {conflict $argold}
+ setConf auto_handling $orig_auto_handling
+ }
}
# attempt load and depre reload only if unload succeed

View File

@ -1,44 +0,0 @@
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]} {

View File

@ -1,18 +0,0 @@
diff --git a/init/profile.sh.in b/init/profile.sh.in
index faa468639..64d21dbcd 100644
--- a/init/profile.sh.in
+++ b/init/profile.sh.in
@@ -3,7 +3,11 @@
# get current shell name by querying shell variables or looking at parent
# process name
if [ -n "${BASH:-}" ]; then
- shell=${BASH##*/}
+ if [ "${BASH##*/}" = 'sh' ]; then
+ shell='sh'
+ else
+ shell='bash'
+ fi
elif [ -n "${ZSH_NAME:-}" ]; then
shell=$ZSH_NAME
else

View File

@ -2,26 +2,35 @@
%global vimdatadir %{_datadir}/vim/vimfiles
Name: environment-modules
Version: 4.5.2
Release: 4%{?dist}
Version: 5.3.0
Release: 1%{?dist}
Summary: Provides dynamic modification of a user's environment
Group: System Environment/Base
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
Patch0003: environment-modules-profilesh-misdetects-login-shell.patch
Patch0004: environment-modules-module-switch-mod-modvers.patch
BuildRequires: tcl-devel, libX11-devel
BuildRequires: dejagnu, sed, procps, hostname, man, less
BuildRequires: python3-devel
Requires: tcl, sed, procps, man, less
BuildRequires: tcl
BuildRequires: dejagnu
BuildRequires: make
BuildRequires: sed
BuildRequires: less
BuildRequires: hostname
BuildRequires: procps-ng
# specific requirements to build extension library
BuildRequires: gcc
BuildRequires: tcl-devel
Requires: tcl
Requires: sed
Requires: less
Requires: vim-filesystem
Requires: procps-ng
Requires: man-db
Requires(post): coreutils
Requires(post): %{_sbindir}/update-alternatives
Requires(postun): %{_sbindir}/update-alternatives
Provides: environment(modules)
Provides: environment(modules)
Obsoletes: environment-modules-compat <= 4.8.99
%description
The Environment Modules package provides for the dynamic modification of
@ -47,18 +56,6 @@ suite of different applications.
NOTE: You will need to get a new shell after installing this package to
have access to the module alias.
%package compat
Summary: Environment Modules compatibility version
Requires: environment-modules = %{version}-%{release}
Requires: hostname
%description compat
The Environment Modules package provides for the dynamic modification of
a user's environment via modulefiles.
This package provides Environment Modules compatibility version (3.2).
%prep
%autosetup -p1 -n modules-%{version}
@ -69,61 +66,55 @@ This package provides Environment Modules compatibility version (3.2).
--etcdir=%{_sysconfdir}/%{name} \
--bindir=%{_datadir}/Modules/bin \
--libexecdir=%{_datadir}/Modules/libexec \
--docdir=%{_docdir}/%{name} \
--mandir=%{_mandir} \
--vimdatadir=%{vimdatadir} \
--enable-dotmodulespath \
--disable-set-shell-startup \
--with-python=%{__python3} \
--with-initconf-in=etcdir \
--enable-multilib-support \
--disable-doc-install \
--disable-nagelfar-addons \
--enable-modulespath \
--with-python=/usr/bin/python3 \
--with-modulepath=%{_datadir}/Modules/modulefiles:%{_sysconfdir}/modulefiles:%{_datadir}/modulefiles \
--with-quarantine-vars='LD_LIBRARY_PATH LD_PRELOAD'
make %{?_smp_mflags}
%make_build
%install
make install DESTDIR=%{buildroot}
%make_install
mkdir -p %{buildroot}%{_sysconfdir}/modulefiles
mkdir -p %{buildroot}%{_datadir}/modulefiles
mkdir -p %{buildroot}%{_sysconfdir}/profile.d
mkdir -p %{buildroot}%{_bindir}
# Set up for alternatives.
# setup for alternatives
touch %{buildroot}%{_sysconfdir}/profile.d/modules.{csh,sh}
touch %{buildroot}%{_bindir}/modulecmd
# remove modulecmd wrapper as it will be handled by alternatives
rm -f %{buildroot}%{_datadir}/Modules/bin/modulecmd
mv %{buildroot}%{_mandir}/man1/module{,-c}.1
mv %{buildroot}%{_mandir}/man4/modulefile{,-c}.4
# Major utilities go to regular bin dir.
# major utilities go to regular bin dir
mv %{buildroot}%{_datadir}/Modules/bin/envml %{buildroot}%{_bindir}/
# Rename compat docs to find them in files section.
mv compat/ChangeLog ChangeLog-compat
mv compat/NEWS NEWS-compat
mv {doc/build/,}NEWS.txt
mv {doc/build/,}MIGRATING.txt
mv {doc/build/,}diff_v3_v4.txt
mv {doc/,}example.txt
rm -f %{buildroot}%{_docdir}/%{name}/{COPYING.GPLv2,ChangeLog-compat,INSTALL{,-win}.txt,NEWS-compat}
cp -p script/createmodule.sh %{buildroot}%{_datadir}/Modules/bin
cp -p script/createmodule.py %{buildroot}%{_datadir}/Modules/bin
mv {doc/build/,}CONTRIBUTING.txt
mv {doc/build/,}INSTALL.txt
mv {doc/build/,}changes.txt
# install the rpm config file
install -Dpm 644 contrib/rpm/macros.%{name} %{buildroot}/%{macrosdir}/macros.%{name}
%check
make test
make test QUICKTEST=1
%post
# Cleanup from pre-alternatives
[ ! -L %{_mandir}/man1/module.1.gz ] && rm -f %{_mandir}/man1/module.1.gz
[ ! -L %{_mandir}/man4/modulefile.4.gz ] && rm -f %{_mandir}/man4/modulefile.4.gz
[ ! -L %{_sysconfdir}/profile.d/modules.sh ] && rm -f %{_sysconfdir}/profile.d/modules.sh
[ ! -L %{_sysconfdir}/profile.d/modules.csh ] && rm -f %{_sysconfdir}/profile.d/modules.csh
[ ! -L %{buildroot}%{_bindir}/modulecmd ] && rm -f %{_bindir}/modulecmd
[ ! -L %{_bindir}/modulecmd ] && rm -f %{_bindir}/modulecmd
# Migration from version 3.x to 4
if [ "$(readlink /etc/alternatives/modules.sh)" = '%{_datadir}/Modules/init/modules.sh' ]; then
@ -133,30 +124,16 @@ fi
%{_sbindir}/update-alternatives \
--install %{_sysconfdir}/profile.d/modules.sh modules.sh %{_datadir}/Modules/init/profile.sh 40 \
--slave %{_sysconfdir}/profile.d/modules.csh modules.csh %{_datadir}/Modules/init/profile.csh \
--slave %{_bindir}/modulecmd modulecmd %{_datadir}/Modules/libexec/modulecmd.tcl \
--slave %{_mandir}/man1/module.1.gz module.1.gz %{_mandir}/man1/module-c.1.gz \
--slave %{_mandir}/man4/modulefile.4.gz modulefile.4.gz %{_mandir}/man4/modulefile-c.4.gz
%post compat
%{_sbindir}/update-alternatives \
--install %{_sysconfdir}/profile.d/modules.sh modules.sh %{_datadir}/Modules/init/profile-compat.sh 10 \
--slave %{_sysconfdir}/profile.d/modules.csh modules.csh %{_datadir}/Modules/init/profile-compat.csh \
--slave %{_bindir}/modulecmd modulecmd %{_datadir}/Modules/libexec/modulecmd-compat
--slave %{_bindir}/modulecmd modulecmd %{_datadir}/Modules/libexec/modulecmd.tcl
%postun
if [ $1 -eq 0 ] ; then
%{_sbindir}/update-alternatives --remove modules.sh %{_datadir}/Modules/init/profile.sh
fi
%postun compat
if [ $1 -eq 0 ] ; then
%{_sbindir}/update-alternatives --remove modules.sh %{_datadir}/Modules/init/profile-compat.sh
fi
%files
%license COPYING.GPLv2
%doc ChangeLog README NEWS.txt MIGRATING.txt CONTRIBUTING.txt diff_v3_v4.txt example.txt
%doc ChangeLog README NEWS.txt MIGRATING.txt INSTALL.txt CONTRIBUTING.txt changes.txt
%{_sysconfdir}/modulefiles
%ghost %{_sysconfdir}/profile.d/modules.csh
%ghost %{_sysconfdir}/profile.d/modules.sh
@ -176,61 +153,135 @@ fi
%{_datadir}/Modules/modulefiles
%{_datadir}/modulefiles
%{_mandir}/man1/ml.1.gz
%ghost %{_mandir}/man1/module.1.gz
%ghost %{_mandir}/man4/modulefile.4.gz
%{_mandir}/man1/module-c.1.gz
%{_mandir}/man4/modulefile-c.4.gz
%{_mandir}/man1/module.1.gz
%{_mandir}/man4/modulefile.4.gz
%{macrosdir}/macros.%{name}
%{vimdatadir}/ftdetect/modulefile.vim
%{vimdatadir}/ftplugin/modulefile.vim
%{vimdatadir}/syntax/modulefile.vim
%files compat
%doc ChangeLog-compat NEWS-compat
%{_datadir}/Modules/libexec/modulecmd-compat
%{_mandir}/man1/module-compat.1.gz
%{_mandir}/man4/modulefile-compat.4.gz
%changelog
* Mon Apr 24 2023 Lukáš Zaoral <lzaoral@redhat.com> - 4.5.2-4
- Fix `module switch mod mod/vers` module loading (#2189252)
* Wed May 17 2023 Lukáš Zaoral <lzaoral@redhat.com> - 5.3.0-1
- Rebase to environment-modules 5.3.0 (rhbz#2207885)
* Wed Sep 21 2022 Lukáš Zaoral <lzaoral@redhat.com> - 4.5.2-3
- Fix profile.sh login shell misdetection (#1815047)
* Thu Sep 22 2022 Lukáš Zaoral <lzaoral@redhat.com> - 5.0.1-2
- Fix profile.sh login shell misdetection (#2128975)
* Tue Jun 07 2022 Lukáš Zaoral <lzaoral@redhat.com> - 4.5.2-2
- Evaluate both modulespath and initrc during initialization (#1894870)
* Mon Dec 6 2021 Lukáš Zaoral <lzaoral@redhat.com> - 5.0.1-1
- Update to 5.0.1 (#2004402)
* Tue Aug 18 2020 Jan Synáček <jsynacek@redhat.com> - 4.5.2-1
- Update to 4.5.2 (#1860674)
* Wed Sep 15 2021 Lukáš Zaoral <lzaoral@redhat.com> - 5.0.0-1
- Update to 5.0.0 (#2004402)
+ Based on spec by Xavier Delaruelle in Fedora Rawhide. Thanks a lot!
- Configuration guide example.txt is replaced by more up to date INSTALL.txt
document
* Mon Jul 13 2020 Jan Synáček <jsynacek@redhat.com> - 4.5.1-1
- Update to 4.5.1 (#1642837)
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 5.0.0-0.3.alpha
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Thu Jul 09 2020 Jan Synáček <jsynacek@redhat.com> - 4.5.0-1
- Update to 4.5.0 (#1642837)
* Tue Aug 3 2021 Lukáš Zaoral <lzaoral@redhat.com> - 5.0.0-0.2.alpha
- Rebuilt for added gating.yaml. Related rhbz#1989523
* Tue Aug 06 2019 Jan Macku <jamacku@redhat.com> - 4.1.4-4
- Gating rebuilt
* Tue Aug 3 2021 Lukáš Zaoral <lzaoral@redhat.com> - 5.0.0-0.1.alpha
- Update to 5.0.0-alpha (#1989523)
+ Based on spec by Xavier Delaruelle in Fedora Rawhide. Thanks a lot!
- Remove createmodule.sh and createmodule.py utilities ('module sh-to-mod'
should be used instead)
- Remove configure options that have been made default starting version 5.0
- Remove compat subpackage
- Run non-regression tests in quick mode
* Mon Aug 5 2019 Jan Synáček <jsynacek@redhat.com> - 4.1.4-2
- Fix postun script (#1736487)
* Wed May 19 2021 Joe Orton <jorton@redhat.com> - 4.7.0-3
- add bcond for compat subpackage (#1940568)
* Wed Aug 29 2018 Jan Synáček <jsynacek@redhat.com> - 4.1.4-1
- Update to 4.1.4 (#1619619)
- Don't install any files under /usr as config files
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 4.7.0-2
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Tue Jun 26 2018 Jan Synáček <jsynacek@redhat.com> - 4.1.3-2
- Remove unnecessary build dependency on tclx (#1595105)
* Fri Feb 19 2021 Xavier Delaruelle <xavier.delaruelle@cea.fr> - 4.7.0-1
- Update to 4.7.0 (#1930632)
- Align spec syntax with upstream spec file
- Add 'tcl' to the BuildRequires and remove 'man' from this list
- Fix names of 'procps-ng' and 'man-db' packages on Fedora
- Only install manpages through make install, other docs are handled by %%doc
- Remove alternatives mechanism for manpages
* Mon Jun 25 2018 Jan Synáček <jsynacek@redhat.com> - 4.1.3-1
- Update to 4.1.3 (#1594693)
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.6.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Jun 20 2018 Tomas Orsava <torsava@redhat.com> - 4.1.2-2
- Switch hardcoded python3 shebangs into the %%{__python3} macro
- Add missing BuildRequires on python3-devel so that %%{__python3} macro is
defined
* Sun Nov 15 2020 Xavier Delaruelle <xavier.delaruelle@cea.fr> - 4.6.1-1
- Update to 4.6.1 (#1897820)
* Thu Sep 17 2020 Jan Synáček <jsynacek@redhat.com> - 4.6.0-1
- Update to 4.6.0 (#1879374)
* Wed Sep 2 2020 Jan Synáček <jsynacek@redhat.com> - 4.5.3-1
- Update to 4.5.3 (#1874145)
+ Big thanks to Xavier Delaruelle for a spec patch!
* Mon Aug 3 2020 Jan Synáček <jsynacek@redhat.com> - 4.5.2-1
- Update to 4.5.2 (#1842562)
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.5.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Apr 8 2020 Jan Synáček <jsynacek@redhat.com> - 4.5.0-1
- Update to 4.5.0 (#1821883)
+ Big thanks to Xavier Delaruelle for a spec patch!
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.4.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Mon Jan 6 2020 Jan Synáček <jsynacek@redhat.com> - 4.4.1-1
- Update to 4.4.1 (#1787690)
* Wed Nov 27 2019 Jan Synáček <jsynacek@redhat.com> - 4.4.0-1
- Update to 4.4.0 (#1773590)
* Wed Oct 2 2019 Jan Synáček <jsynacek@redhat.com> - 4.3.1-1
- Update to 4.3.1 (#1754182)
* Mon Jul 29 2019 Jan Synáček <jsynacek@redhat.com> - 4.3.0-1
- Update to 4.3.0 (#1733752)
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Tue Jul 9 2019 Jan Synáček <jsynacek@redhat.com> - 4.2.5-1
- Update to 4.2.5 (#1727988)
* Mon Apr 29 2019 Jan Synáček <jsynacek@redhat.com> - 4.2.4-1
- Update to 4.2.4 (#1703415, #1687033)
* Mon Mar 25 2019 Jan Synáček <jsynacek@redhat.com> - 4.2.3-1
- Update to 4.2.3 (#1692024, #1687033)
* Mon Feb 18 2019 Jan Synáček <jsynacek@redhat.com> - 4.2.2-1
- Update to 4.2.2 (#1678041)
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Tue Nov 20 2018 Jan Synáček <jsynacek@redhat.com> - 4.2.1-1
- Update to 4.2.1 (#1648738)
* Thu Oct 18 2018 Jan Synáček <jsynacek@redhat.com> - 4.2.0-1
- Update to 4.2.0 (#1640450)
* Tue Aug 21 2018 Jan Synáček <jsynacek@redhat.com> - 4.1.4-2
- Don't install any files under /usr as config files (#1506663)
* Tue Aug 21 2018 Jan Synáček <jsynacek@redhat.com> - 4.1.4-1
- Update to 4.1.4 (#1619415)
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Mon Jun 18 2018 Jan Synáček <jsynacek@redhat.com> - 4.1.3-1
- Update to 4.1.3 (#1592179, #1575479, #1585305)
* Fri May 4 2018 Jan Synáček <jsynacek@redhat.com> - 4.1.2-2
- Fix postun script (#1565699)
* Tue Apr 3 2018 Jan Synáček <jsynacek@redhat.com> - 4.1.2-1
- Update to 4.1.2 (#1562535)
@ -383,7 +434,7 @@ fi
* Thu Jan 7 2010 Orion Poplawski <orion@cora.nwra.com> - 3.2.7b-7
- Add patch to set a sane default MANPATH
- Add createmodule.sh utility script for creating modulefiles
* Mon Nov 30 2009 Orion Poplawski <orion@cora.nwra.com> - 3.2.7b-6
- Add Requires: propcs (bug #54272)