Fix profile.sh login shell misdetection

Resolves: #2128975
This commit is contained in:
Lukáš Zaoral 2022-09-22 09:35:11 +02:00
parent 76adfaa84e
commit 53726c9955
No known key found for this signature in database
GPG Key ID: 39157506DD67752D
2 changed files with 25 additions and 2 deletions

View File

@ -0,0 +1,18 @@
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

@ -3,13 +3,15 @@
Name: environment-modules
Version: 5.0.1
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Provides dynamic modification of a user's environment
License: GPLv2+
URL: http://modules.sourceforge.net/
Source0: http://downloads.sourceforge.net/modules/modules-%{version}.tar.bz2
Patch1: environment-modules-profilesh-misdetects-login-shell.patch
BuildRequires: tcl
BuildRequires: dejagnu
BuildRequires: make
@ -57,7 +59,7 @@ NOTE: You will need to get a new shell after installing this package to
have access to the module alias.
%prep
%setup -q -n modules-%{version}
%autosetup -p1 -n modules-%{version}
%build
@ -160,6 +162,9 @@ fi
%{vimdatadir}/syntax/modulefile.vim
%changelog
* Thu Sep 22 2022 Lukáš Zaoral <lzaoral@redhat.com> - 5.0.1-2
- Fix profile.sh login shell misdetection (#2128975)
* Mon Dec 6 2021 Lukáš Zaoral <lzaoral@redhat.com> - 5.0.1-1
- Update to 5.0.1 (#2004402)