Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions run_in_compat_layer_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,22 @@ if [ ! -z ${EESSI_SITE_INSTALL_FORCE} ]; then
fi
fi

# The above propagates some hard-coded environment variables into the prefix environment
# Here, we provide a mechanism that propagates ANY variable named PROPAGATE_INTO_PREFIX_<NAME>
# into the prefix environment as "export <NAME>=<value>"
# Example: PROPAGATE_INTO_PREFIX_FOO=bar => export FOO=bar
while IFS='=' read -r var_name var_value; do
# Only act on variables that start with the marker prefix
if [[ ${var_name} == EESSI_PROPAGATE_INTO_PREFIX_* ]]; then
# Strip the marker prefix to obtain the target name
target_name=${var_name#EESSI_PROPAGATE_INTO_PREFIX_}
# Guard against empty target names
if [[ -n ${target_name} ]]; then
INPUT="export ${target_name}=${var_value}; ${INPUT}"
fi
fi
done < <(env) # feed the current environment to the while‑loop


echo "Running '${INPUT}' in EESSI (${EESSI_CVMFS_REPO}) ${EESSI_VERSION} compatibility layer environment..."
${EESSI_COMPAT_LAYER_DIR}/startprefix <<< "${INPUT}"
Loading