Commit 4f4c3b170f86bd4fd41eb562c88c494767731485

Thomas de Grivel 2023-02-15T12:55:33

wip shpkg_ci

diff --git a/share/shpkg/shpkg.subr b/share/shpkg/shpkg.subr
index 2082c84..c6dfbc1 100644
--- a/share/shpkg/shpkg.subr
+++ b/share/shpkg/shpkg.subr
@@ -817,13 +817,16 @@ shpkg_upgrade_shpkg () {
 #  running -> ko, ok
 # additionaly status will be changed to ko if aborted while running
 shpkg_ci_status () {
+    SHPKG_CI_STATUS="$(< "${SHPKG_CI_STATUS_DIR}/$1")"
     if [ "x$2" = "xrunning" ]; then
         verbose -n 1 "echo $2 > ${SHPKG_CI_STATUS_DIR}/$1"
         echo "$2" > "${SHPKG_CI_STATUS_DIR}/$1"
         trap "shpkg_ci_status_trap $1" EXIT
-    elif [ "x$(< "${SHPKG_CI_STATUS_DIR}/$1")" = "xrunning" ]; then
+    elif [ "x${SHPKG_CI_STATUS}" = "xrunning" ]; then
         verbose -n 1 "echo $2 > ${SHPKG_CI_STATUS_DIR}/$1"
         echo "$2" > "${SHPKG_CI_STATUS_DIR}/$1"
+    else
+        verbose -n 2 "Status change blocked: ${SHPKG_CI_STATUS} -> $2"
     fi
 }