Commit e3eab53f74f36b6706cc86c40686bd0f598650a0

Thomas de Grivel 2023-02-15T01:38:01

wip shpkg_ci

diff --git a/bin/shpkg_ci b/bin/shpkg_ci
index e1e82ad..2a27e91 100755
--- a/bin/shpkg_ci
+++ b/bin/shpkg_ci
@@ -70,6 +70,10 @@ logs2html () {
     done
 }
 
+shpkg_build_status () {
+    shpkg_ci_status "$1.build.status" "$2"
+}
+
 # state machine :
 #  any -> running
 #  running -> ko, ok
diff --git a/share/shpkg/shpkg.subr b/share/shpkg/shpkg.subr
index 6b5c849..410d57c 100644
--- a/share/shpkg/shpkg.subr
+++ b/share/shpkg/shpkg.subr
@@ -396,6 +396,7 @@ shpkg_build () {
         if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
             err 1 "shpkg_build: unknown repo: $SHPKG_REPO"
         fi
+        shpkg_build_status "${SHPKG_REPO}" running
         SHPKG_REPO_OBJ_DIR="${SHPKG_OBJ_DIR}/${SHPKG_REPO_DIR}"
         SHPKG_REPO_SRC_DIR="${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}"
         SHPKG_REPO_VERSION="$(shpkg_version "${SHPKG_REPO}")"
@@ -404,8 +405,13 @@ shpkg_build () {
             ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.build.log"; )
             SHPKG_REPO_VERSION="$(shpkg_version "${SHPKG_REPO}")"
             if [ -f "${SHPKG_REPO_SRC_DIR}/Makefile" ]; then
-		( verbose 1 cd "${SHPKG_REPO_SRC_DIR}" &&
-                      verbose 1 make -j "${SHPKG_NCPU}"; )
+		( verbose 1 cd "${SHPKG_REPO_SRC_DIR}"
+                  if verbose 1 make -j "${SHPKG_NCPU}"; then
+                      shpkg_build_status "${SHPKG_REPO}" ok
+                  else
+                      shpkg_build_status "${SHPKG_REPO}" ko
+                      false
+                  fi ; )
             elif [ -f "${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}/CMakeLists.txt" ]; then
 		cmake -j "${SHPKG_NCPU}" --build "${SHPKG_REPO_OBJ_DIR}"
             fi
@@ -414,6 +420,9 @@ shpkg_build () {
     done
 }
 
+shpkg_build_status () {
+}
+
 shpkg_checksum () {
     find . -type f | cut -c 3- | while read F; do
         "shpkg_${SHPKG_SHA256}" "$F"