stdlib/fedora.gl: Add new %fedora-retry-failed flag
authorRichard W.M. Jones <rjones@redhat.com>
Tue, 24 Jan 2023 15:59:33 +0000 (15:59 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Tue, 24 Jan 2023 16:42:16 +0000 (16:42 +0000)
stdlib/fedora.gl

index ef515c6..3a8fa42 100644 (file)
 # detect if a rebuild has been attempted before in this run.
 # eg. "Perl 5.99 rebuild"
 #
+# %fedora-retry-failed:
+# If set to 1 then failed builds are retried automatically.
+# If set to 0 then failed builds must be manually restarted.
+# Normally you want this to be 0.
+#
 # %fedora-source-packages:
 # List of source packages that will be rebuilt.
 #
@@ -82,8 +87,13 @@ predicate is-koji-built (pkg) = {
         # Complete so we don't need to rebuild.
         exit 0 ;;
     FAILED)
-        # Failed builds must be examined and fixed manually.
-        exit 1 ;;
+        if [ %fedora-retry-failed -ne 0 ]; then
+            # Resubmit it automatically.
+            exit 99
+        else
+            # Fail, must be examined and retried manually.
+            exit 1
+        fi ;;
     BUILDING)
         # Cancel the build, we will resubmit it.
         koji cancel $taskid ||: