From 2b7aad26f90ec39157a707eaf81e25501c8f64c8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Oriol=20Tint=C3=B3?= <oriol.tinto@lmu.de>
Date: Thu, 25 May 2023 10:16:26 +0200
Subject: [PATCH] Fix SPACK_LOAD_ICON .

---
 conf/common/build.yml          | 2 +-
 templates/common/build_icon.sh | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/conf/common/build.yml b/conf/common/build.yml
index d235d17..e87dffb 100644
--- a/conf/common/build.yml
+++ b/conf/common/build.yml
@@ -28,7 +28,7 @@ icon:
   # in most cases it can be the same value as the build_cmd, but for some cases where using dependencies with a
   # specific hash it doesn't work anymore. For those cases, the default value can be replaced by the build_cmd without
   # the dependencies with hash.
-  load_cmd: "%icon.build_cmd%"
+  load_cmd: build_cmd
   version: master # The latest release at the moment of creating this file was 2.6.5-nwp0
 
 python_environment:
diff --git a/templates/common/build_icon.sh b/templates/common/build_icon.sh
index 6558938..bac7789 100644
--- a/templates/common/build_icon.sh
+++ b/templates/common/build_icon.sh
@@ -25,6 +25,10 @@ fi
 SPACK_BUILD_ICON="%ICON.BUILD_CMD%"
 SPACK_LOAD_ICON="%ICON.LOAD_CMD%"
 
+if [ "${SPACK_LOAD_ICON}" == "build_cmd" ]; then
+  SPACK_LOAD_ICON=${SPACK_BUILD_ICON}
+fi
+
 if [ ! -z "$SPACK_BUILD_ICON" ]; then
   echo "Installing ICON with spack!"
   echo "cmd=$SPACK_BUILD_ICON"
-- 
GitLab