Commit 4e0617beb71df58fa0e1964d5893c1b78ec6509f

Thomas de Grivel 2023-02-16T02:11:38

wip shpkg_ci

diff --git a/bin/shpkg_ci b/bin/shpkg_ci
index 790a6b2..539dbc3 100755
--- a/bin/shpkg_ci
+++ b/bin/shpkg_ci
@@ -83,17 +83,6 @@ logs2html () {
     done
 }
 
-status2png () {
-    for F in "${SHPKG_CI_STATUS_DIR}"/*.status; do
-        STATUS="$(cat "$F")"
-        I="${SHPKG_CI_LOG_DIR}/$(basename "$F" .status).png"
-        if ! [ -f "$I" ] ||
-                [ "$F" -nt "$I" ]; then
-            verbose 1 cp "${SHPKG_DIR}/share/shpkg/img/status_${STATUS}.64.png" "$I"
-        fi
-    done
-}
-
 main () {
     verbose 2 shpkg_ci_status "shpkg_ci.status" running
     for SHPKG_REPO; do
@@ -134,7 +123,7 @@ main () {
               fi; )
             if verbose 1 cp -p "${SHPKG_REPO_BUILD_DIR}/var/log/shpkg/tags/${SHPKG_REPO}".*.log "${SHPKG_CI_LOG_DIR}"; then
                 verbose 2 logs2html
-                verbose 2 status2png
+                verbose 2 shpkg_ci_status2png
             fi
         fi
         ( verbose 2 shpkg_bootstrap -f "${SHPKG_REPO_BUILD_DIR}"; )
@@ -161,12 +150,12 @@ main () {
         fi
         if [ "x${SHPKG_CI_COPY}" = "xYes" ]; then
             verbose 2 logs2html
-            verbose 2 status2png
+            verbose 2 shpkg_ci_status2png
         fi
     done
     verbose 2 shpkg_ci_status "shpkg_ci.status" ok
     verbose 2 logs2html
-    verbose 2 status2png
+    verbose 2 shpkg_ci_status2png
 }
 
 if [ "x$1" = "x--clean" ]; then
diff --git a/bin/shpkg_ci_mux b/bin/shpkg_ci_mux
index 9ade0c0..74f08a5 100755
--- a/bin/shpkg_ci_mux
+++ b/bin/shpkg_ci_mux
@@ -29,6 +29,17 @@ shpkg_ci_remote () {
     fi
 }
 
+shpkg_ci_status2png () {
+    for F in "${SHPKG_CI_DIR}/status"/*.status; do
+        STATUS="$(cat "$F")"
+        I="${SHPKG_CI_DIR}/log/$(basename "$F" .status).png"
+        if ! [ -f "$I" ] ||
+                [ "$F" -nt "$I" ]; then
+            verbose 1 cp "${SHPKG_DIR}/share/shpkg/img/status_${STATUS}.64.png" "$I"
+        fi
+    done
+}
+
 main () {
     SHPKG_REPO="$1"
     shift
diff --git a/share/shpkg/shpkg.subr b/share/shpkg/shpkg.subr
index d0d11ab..56b7ee1 100644
--- a/share/shpkg/shpkg.subr
+++ b/share/shpkg/shpkg.subr
@@ -842,3 +842,14 @@ shpkg_ci_status_trap () {
         echo ko > "${SHPKG_CI_STATUS_DIR}/$1"
     fi
 }
+
+shpkg_ci_status2png () {
+    for F in "${SHPKG_CI_STATUS_DIR}"/*.status; do
+        STATUS="$(cat "$F")"
+        I="${SHPKG_CI_LOG_DIR}/$(basename "$F" .status).png"
+        if ! [ -f "$I" ] ||
+                [ "$F" -nt "$I" ]; then
+            verbose 1 cp "${SHPKG_DIR}/share/shpkg/img/status_${STATUS}.64.png" "$I"
+        fi
+    done
+}