From 27243c73965c9ee3c76ff13c51e01abe6df15839 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Mon, 26 Oct 2009 17:01:51 +0000 Subject: [PATCH] - Don't assume different shell init scripts exist (bug #530770) --- environment-modules.spec | 5 ++++- modules.sh | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/environment-modules.spec b/environment-modules.spec index 6fc11e7..4615ccd 100644 --- a/environment-modules.spec +++ b/environment-modules.spec @@ -1,6 +1,6 @@ Name: environment-modules Version: 3.2.7b -Release: 4%{?dist} +Release: 5%{?dist} Summary: Provides dynamic modification of a user's environment Group: System Environment/Base @@ -78,6 +78,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon Oct 26 2009 Orion Poplawski - 3.2.7b-5 +- Don't assume different shell init scripts exist (bug #530770) + * Fri Oct 23 2009 Orion Poplawski - 3.2.7b-4 - Don't load bash init script when bash is running as "sh" (bug #529745) diff --git a/modules.sh b/modules.sh index fd98eaf..48cc324 100644 --- a/modules.sh +++ b/modules.sh @@ -1 +1,7 @@ -. /usr/share/Modules/init/`basename \`ps -p $$ -ocomm=\`` +shell=`/bin/basename \`/bin/ps -p $$ -ocomm=\`` +if [ -f /usr/share/Modules/init/$shell ] +then + . /usr/share/Modules/init/$shell +else + . /usr/share/Modules/init/sh +fi