]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
mailbot: get build results via stdout output
authorSasha Levin <sashal@kernel.org>
Wed, 2 Jul 2025 03:04:26 +0000 (23:04 -0400)
committerSasha Levin <sashal@kernel.org>
Wed, 2 Jul 2025 03:04:26 +0000 (23:04 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
scripts/mailbot.sh

index 2ca3a71a8f205feb4266c8b9d8a343dccaf0625b..6c1b34e14f8f4d8f5d5f389518ddfed26a966358 100755 (executable)
@@ -862,15 +862,18 @@ test_commit_on_branch() {
     fi
 
     # Run build test
-    if ! stable build; then
-        if [ -f ~/errors-linus-next ]; then
-            local build_error=$(cat ~/errors-linus-next)
-            results+=("stable/linux-${version}.y | Success | Failed")
+    local build_output
+    build_output=$(stable build log 2>&1)
+    local build_ret=$?
+
+    if [ $build_ret -ne 0 ]; then
+        results+=("stable/linux-${version}.y | Success | Failed")
+        if [ -n "$build_output" ]; then
             errors+=("Build error for ${branch}:")
-            errors+=("$(echo "$build_error" | sed 's/^/    /')")
+            errors+=("$(echo "$build_output" | sed 's/^/    /')")
             errors+=("")
         else
-            results+=("stable/linux-${version}.y | Success | Failed (no log)")
+            errors+=("Build error for ${branch}: (no output captured)")
         fi
         result=1
     else
@@ -1083,15 +1086,18 @@ Commit author: $commit_author"
             failed=1
         else
             # Run build test
-            if ! stable build; then
-                if [ -f ~/errors-linus-next ]; then
-                    local build_error=$(cat ~/errors-linus-next)
-                    p_results+=("$full_branch_name | Success | Failed")
+            local build_output
+            build_output=$(stable build log 2>&1)
+            local build_ret=$?
+
+            if [ $build_ret -ne 0 ]; then
+                p_results+=("$full_branch_name | Success | Failed")
+                if [ -n "$build_output" ]; then
                     p_errors+=("Build error:")
-                    p_errors+=("$(echo "$build_error" | sed 's/^/    /')")
+                    p_errors+=("$(echo "$build_output" | sed 's/^/    /')")
                     p_errors+=("")
                 else
-                    p_results+=("$full_branch_name | Success | Failed (no log)")
+                    p_errors+=("Build error: (no output captured)")
                 fi
                 failed=1
             else