Skip to content
Snippets Groups Projects
Commit ea767d8e authored by Oriol Tintó's avatar Oriol Tintó
Browse files

Trying to use a lock file.

parent 07dce8df
No related branches found
No related tags found
No related merge requests found
Pipeline #18784 failed
......@@ -6,7 +6,14 @@ function _install_spack() {
_init_spack "$SPACK_INIT_CMD" "$SPACK_ROOT"
# Adding a lock file to prevent race conditions.
UPSTREAMS_LOCK=${SPACK_ROOT}/etc/spack/upstreams.lock
while [ -f "${UPSTREAMS_LOCK}" ]; do
sleep 1
done
if [ ! -z "${SPACK_UPSTREAMS}" ]; then
touch ${UPSTREAMS_LOCK}
UPSTREAMS_CONFIG=${SPACK_ROOT}/etc/spack/upstreams.yaml
echo "upstreams:" > $UPSTREAMS_CONFIG
i=0
......@@ -18,6 +25,7 @@ function _install_spack() {
install_tree: $UP
EOF
done
rm ${UPSTREAMS_LOCK}
fi
if [ ! -z "${SPACK_EXTERNALS}" ] ; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment