Skip to content

Commit 71d2740

Browse files
opoplawskiadrianreber
authored andcommitted
Fix setting MANPATH in csh
Signed-off-by: Orion Poplawski <orion@nwra.com>
1 parent 7439bae commit 71d2740

1 file changed

Lines changed: 15 additions & 11 deletions

File tree

components/admin/lmod/SPECS/lmod.spec

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Release: %{?dist}.1
2121
License: MIT
2222
Group: %{PROJ_NAME}/admin
2323
Url: https://github.com/TACC/Lmod
24-
Source0: https://github.com/TACC/Lmod/archive/%{version}.tar.gz#$/%{pname}-%{version}.tar.gz
24+
Source0: https://github.com/TACC/Lmod/archive/%{version}/%{pname}-%{version}.tar.gz
2525

2626
BuildRequires: rsync
2727
BuildRequires: tcl-devel
@@ -86,7 +86,7 @@ make DESTDIR=$RPM_BUILD_ROOT install
8686
# Customize startup script to suit
8787

8888
%{__mkdir_p} %{buildroot}/%{_sysconfdir}/profile.d
89-
%{__cat} << EOF > %{buildroot}/%{_sysconfdir}/profile.d/lmod.sh
89+
%{__cat} << 'EOF' > %{buildroot}/%{_sysconfdir}/profile.d/lmod.sh
9090
#!/bin/sh
9191
# -*- shell-script -*-
9292
########################################################################
@@ -96,7 +96,7 @@ make DESTDIR=$RPM_BUILD_ROOT install
9696
########################################################################
9797

9898
# NOOP if running under known resource manager
99-
if [ ! -z "\$SLURM_NODELIST" ] || [ ! -z "\$PBS_NODEFILE" ]; then
99+
if [ ! -z "$SLURM_NODELIST" ] || [ ! -z "$PBS_NODEFILE" ]; then
100100
return
101101
fi
102102

@@ -105,17 +105,17 @@ export LMOD_FULL_SETTARG_SUPPORT=no
105105
export LMOD_COLORIZE=no
106106
export LMOD_PREPEND_BLOCK=normal
107107

108-
if [ \$EUID -eq 0 ]; then
108+
if [ $EUID -eq 0 ]; then
109109
export MODULEPATH=%{OHPC_ADMIN}/modulefiles:%{OHPC_MODULES}
110110
else
111111
export MODULEPATH=%{OHPC_MODULES}
112112
fi
113113

114114
# Add : to MANPATH to not drop default search paths, then safely append Lmod's
115115
# man directory using addto helper
116-
export MANPATH="\${MANPATH}:"
116+
export MANPATH="${MANPATH}:"
117117

118-
export MANPATH=\$(%{OHPC_ADMIN}/lmod/lmod/libexec/addto MANPATH %{OHPC_ADMIN}/lmod/lmod/share/man)
118+
export MANPATH=$(%{OHPC_ADMIN}/lmod/lmod/libexec/addto MANPATH %{OHPC_ADMIN}/lmod/lmod/share/man)
119119

120120
# Set BASH_ENV for environment
121121
export BASH_ENV=%{OHPC_ADMIN}/lmod/lmod/init/bash
@@ -128,7 +128,7 @@ module try-add ohpc
128128

129129
EOF
130130

131-
%{__cat} << EOF > %{buildroot}/%{_sysconfdir}/profile.d/lmod.csh
131+
%{__cat} << 'EOF' > %{buildroot}/%{_sysconfdir}/profile.d/lmod.csh
132132
#!/bin/csh
133133
# -*- shell-script -*-
134134
########################################################################
@@ -137,11 +137,11 @@ EOF
137137
#
138138
########################################################################
139139

140-
if ( \$?SLURM_NODELIST ) then
140+
if ( $?SLURM_NODELIST ) then
141141
exit 0
142142
endif
143143

144-
if ( \$?PBS_NODEFILE ) then
144+
if ( $?PBS_NODEFILE ) then
145145
exit 0
146146
endif
147147

@@ -151,15 +151,19 @@ setenv LMOD_COLORIZE "no"
151151
setenv LMOD_PREPEND_BLOCK "normal"
152152

153153

154-
if ( \`id -u\` == "0" ) then
154+
if ( `id -u` == "0" ) then
155155
setenv MODULEPATH "%{OHPC_ADMIN}/modulefiles:%{OHPC_MODULES}"
156156
else
157157
setenv MODULEPATH "%{OHPC_MODULES}"
158158
endif
159159

160160
# Add : to MANPATH to not drop default search paths, then safely append Lmod's
161161
# man directory using addto helper
162-
setenv MANPATH "\${MANPATH}:"
162+
if ( $?MANPATH ) then
163+
setenv MANPATH "${MANPATH}:"
164+
else
165+
setenv MANPATH ":"
166+
endif
163167
setenv MANPATH `%{OHPC_ADMIN}/lmod/lmod/libexec/addto MANPATH %{OHPC_ADMIN}/lmod/lmod/share/man`
164168

165169
# Initialize modules system

0 commit comments

Comments
 (0)