|
24 | 24 | #
|
25 | 25 | set -o pipefail
|
26 | 26 |
|
| 27 | +EESSI_EXTEND_EASYCONFIG="EESSI-extend-easybuild.eb" |
| 28 | + |
27 | 29 | # this script is *sourced*, not executed, so can't rely on $0 to determine path to self or script name
|
28 | 30 | # $BASH_SOURCE points to correct path or script name, see also http://mywiki.wooledge.org/BashFAQ/028
|
29 | 31 | if [ $# -ne 1 ]; then
|
@@ -65,11 +67,25 @@ ml_av_eessi_extend_out=${TMPDIR}/ml_av_eessi_extend.out
|
65 | 67 | # need to use --ignore_cache to avoid the case that the module was removed (to be
|
66 | 68 | # rebuilt) but it is still in the cache
|
67 | 69 | module --ignore_cache avail 2>&1 | grep -i EESSI-extend/${EESSI_EXTEND_VERSION} &> ${ml_av_eessi_extend_out}
|
68 |
| - |
69 | 70 | if [[ $? -eq 0 ]]; then
|
70 | 71 | echo_green ">> Module for EESSI-extend/${EESSI_EXTEND_VERSION} found!"
|
| 72 | + install_eessi_extend=false |
| 73 | + rebuild_eessi_extend=false |
| 74 | + # $PR_DIFF should be set by the calling script (EESSI-install-software.sh) |
| 75 | + if [[ ! -z ${PR_DIFF} ]] && [[ -f "$PR_DIFF" ]]; then |
| 76 | + # check if EESSI-extend easyconfig was modified; if so, we need to rebuild it |
| 77 | + grep -q "^\+\+\+ b/${EESSI_EXTEND_EASYCONFIG}" "${PR_DIFF}" |
| 78 | + if [[ $? -eq 0 ]]; then |
| 79 | + rebuild_eessi_extend=true |
| 80 | + fi |
| 81 | + fi |
71 | 82 | else
|
72 | 83 | echo_yellow ">> No module yet for EESSI-extend/${EESSI_EXTEND_VERSION}, installing it..."
|
| 84 | + install_eessi_extend=true |
| 85 | + rebuild_eessi_extend=false |
| 86 | +fi |
| 87 | + |
| 88 | +if [ "${install_eessi_extend}" = true ] || [ "${rebuild_eessi_extend}" = true ]; then |
73 | 89 |
|
74 | 90 | EB_TMPDIR=${TMPDIR}/ebtmp
|
75 | 91 | echo ">> Using temporary installation of EasyBuild (in ${EB_TMPDIR})..."
|
|
98 | 114 | eessi_install_out=${TMPDIR}/eessi_install.out
|
99 | 115 | ok_msg="EESSI-extend/${EESSI_EXTEND_VERSION} installed, let's go!"
|
100 | 116 | fail_msg="Installing EESSI-extend/${EESSI_EXTEND_VERSION} failed, that's not good... (output: ${eessi_install_out})"
|
| 117 | + |
101 | 118 | # while always adding --try-amend=keep... may do no harm, we could make
|
102 | 119 | # an attempt to figure out if it is needed, e.g., when we are rebuilding
|
103 |
| - ${EB} "EESSI-extend-easybuild.eb" --try-amend=keeppreviousinstall=True 2>&1 | tee ${eessi_install_out} |
| 120 | + eb_args="" |
| 121 | + if [ "${rebuild_eessi_extend}" = true ]; then |
| 122 | + eb_args+="--rebuild" |
| 123 | + fi |
| 124 | + echo ">> Installing EESSI-extend with '${EB} ${eb_args} ${EESSI_EXTEND_EASYCONFIG}'..." |
| 125 | + ${EB} ${eb_args} "${EESSI_EXTEND_EASYCONFIG}" 2>&1 | tee ${eessi_install_out} |
104 | 126 | check_exit_code $? "${ok_msg}" "${fail_msg}"
|
105 | 127 | )
|
106 | 128 |
|
|
0 commit comments