Commit 0325c898c7d8e9b31130f8a48d6e07923e87f134

Thomas de Grivel 2023-02-18T16:23:10

wip ci

diff --git a/share/shpkg/shpkg.subr b/share/shpkg/shpkg.subr
index 2a15958..f766d45 100644
--- a/share/shpkg/shpkg.subr
+++ b/share/shpkg/shpkg.subr
@@ -92,8 +92,16 @@ shpkg_log () {
     SHPKG_NAME="$1"
     shift
     shpkg_start_logging "${SHPKG_NAME}"
-    { shpkg_redirect_err "$@"; RESULT=$?; } | tee -a "${SHPKG_LOG}"
-    return $RESULT
+    shpkg_redirect_err "$@" >> "${SHPKG_LOG}" &
+    PID1=$!
+    tail -n 1000000 -f "${SHPKG_LOG}" &
+    PID2=$!
+    set +e
+    wait $PID1
+    RET=$?
+    kill $PID2
+    wait $PID2
+    return $RET
 }
 
 shpkg_redirect_err () {
@@ -105,6 +113,7 @@ shpkg_start_logging () {
     SHPKG_LOG_NAME="$1_${SHPKG_DATE}_$$.log"
     SHPKG_LOG="${SHPKG_LOG_ALL_DIR}/${SHPKG_LOG_NAME}"
     SHPKG_LOG_RELATIVE="../all/${SHPKG_LOG_NAME}"
+    SHPKG_LOG_RET="${SHPKG_LOG}.ret"
     SHPKG_LOG_TAGS_DIR="${SHPKG_LOG_DIR}/tags"
     SHPKG_LOG_TMP_DIR="${SHPKG_LOG_DIR}/tmp"
     if [ -f "${SHPKG_LOG}" ]; then
@@ -516,14 +525,10 @@ shpkg_configure () {
             fi
             if [ -x "${SHPKG_REPO_SRC_DIR}/configure" ]; then
                 ( verbose 1 cd "${SHPKG_REPO_SRC_DIR}"
-                  verbose 1 ./configure --prefix "${SHPKG_PREFIX}"
-                  echo $? >&2
-                  exit $?; )
-                  echo $? >&2
+                  verbose 1 ./configure --prefix "${SHPKG_PREFIX}" )
             elif [ -x "${SHPKG_REPO_SRC_DIR}/configure.sh" ]; then
                 ( verbose 1 cd "${SHPKG_REPO_SRC_DIR}"
-                  verbose 1 ./configure.sh --prefix "${SHPKG_PREFIX}"
-                  exit $?; )
+                  verbose 1 ./configure.sh --prefix "${SHPKG_PREFIX}" )
             elif [ -f "${SHPKG_REPO_SRC_DIR}/CMakeLists.txt" ]; then
                 verbose 1 cmake -S "${SHPKG_REPO_SRC_DIR}" -B "${SHPKG_OBJ_DIR}/${SHPKG_REPO_DIR}" -D CMAKE_INSTALL_PREFIX:PATH="${SHPKG_PREFIX}" -D BUILD_SHARED_LIBS=ON
             fi