Skip to content
Open
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
31 changes: 31 additions & 0 deletions EESSI-install-software.sh
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,37 @@ else
echo_green "All set, let's start installing some software with EasyBuild v${eb_version} in ${EASYBUILD_INSTALLPATH}..."

if [ -f ${easystack_file} ]; then
if [ -z $EESSI_SKIP_FETCH_EASYSTACK_SOURCES ]; then
# run eb --help to determine if --fetch-all is supported (available since 5.3.0), otherwise fall back to --fetch
fetch_option="--fetch"
${EB} --help | grep -q -e "fetch-all" && fetch_option="--fetch-all"
easystack_additions=$(mktemp --suffix=.yml)
# use the PR diff file to find which items have been added to this particular easystack file
# and dump that to a temporary easystack file that we can use to fetch the sources for only these added items
awk -v file="${easystack_file}" '

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure awk is available everywhere we need it to be?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both the compat layer and container have awk.

/^diff --git / { found=0 }
$0 == "+++ b/" file { found=1; next }
found && /^\+/ && !/^\+\+\+/ {
sub(/^\+/, "")
additions = additions $0 "\n"
count++
}
END {
if (count)
printf "easyconfigs:\n%s", additions
else
print "easyconfigs: []"
}
' "${diff_file}" >> ${easystack_additions}
echo_green "Downloading sources for added items in easystack file ${easystack_file} using eb ${fetch_option}..."
echo '(note: this step can be skipped by setting $EESSI_SKIP_FETCH_EASYSTACK_SOURCES to a non-empty value)'
${EB} ${fetch_option} --easystack ${easystack_additions} --robot
if [ $? -ne 0 ]; then
fatal_error "Could not download all required source files for this easystack file."
fi
rm ${easystack_additions}
fi

echo_green "Feeding easystack file ${easystack_file} to EasyBuild..."

if [[ ${easystack_file} == *"/rebuilds/"* ]]; then
Expand Down
Loading