Skip to content

Commit 9747ee4

Browse files
author
torri
committed
simplified the implementation
1 parent f07fd85 commit 9747ee4

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

init/eessi_environment_variables

+5-15
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,6 @@ function show_msg {
1515
fi
1616
}
1717

18-
function check_rhel_ca {
19-
20-
os=$(grep -oP '(?<=^ID_LIKE=).+' /etc/os-release | tr -d '"')
21-
22-
version_id=$(grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"')
23-
version_major=${version_id%\.*}
24-
25-
if [[ $os =~ "rhel" ]] && [ $version_major -gt 7 ]
26-
then
27-
export CURL_CA_BUNDLE=/etc/pki/tls/certs/ca-bundle.crt
28-
fi
29-
}
30-
31-
3218
# set up minimal environment: $EESSI_PREFIX, $EESSI_VERSION, $EESSI_OS_TYPE, $EESSI_CPU_FAMILY, $EPREFIX
3319
source $EESSI_INIT_DIR_PATH/minimal_eessi_env
3420

@@ -121,7 +107,11 @@ if [ -d $EESSI_PREFIX ]; then
121107
fi
122108

123109
# Fix wrong path for RHEL >=8 libcurl
124-
check_rhel_ca
110+
rhel_libcurl_file="/etc/pki/tls/certs/ca-bundle.crt"
111+
if [ -f $rhel_libcurl_file ]; then
112+
show_msg "Found libcurl CAs file at RHEL location, setting CURL_CA_BUNDLE"
113+
export CURL_CA_BUNDLE=$rhel_libcurl_file
114+
fi
125115

126116
else
127117
error "EESSI software layer at $EESSI_SOFTWARE_PATH not found!"

0 commit comments

Comments
 (0)