Add '--max-retry-times' to support rebuild if build failed. sandbox/xuwc/max_retry_times
authorwanchao.xu <wanchao.xu@samsung.com>
Thu, 5 Dec 2024 01:30:49 +0000 (09:30 +0800)
committerwanchao.xu <wanchao.xu@samsung.com>
Thu, 5 Dec 2024 02:53:41 +0000 (10:53 +0800)
*Support to rebuild package if gbs build failed because of some issues which maybe not reproduced.

Change-Id: I174a0987035a16a293dc0e4cd2ae3ac4a88903de
Signed-off-by: wanchao.xu <wanchao.xu@samsung.com>
depanneur

index ba23f9fcde83e413ebfbc339ed505421c121eaf5..a43ffab0014177fdb13beb536dfd20a23f9329ac 100755 (executable)
--- a/depanneur
+++ b/depanneur
@@ -206,6 +206,7 @@ my $with_submodules = 0; #didn't export sub modules source code.
 my $work_done = 0; # Whether build jobs finished
 my $release_tag = ""; # Override Release in spec file
 my $nocumulate = 0; # Whether build without cumulative build.
+my $max_retry_times = 0; # max retry times of rebuild if build failed.
 
 GetOptions (
     "repository=s" => \@repos,
@@ -271,6 +272,7 @@ GetOptions (
     "with-submodules" => \$with_submodules,
     "release=s" => \$release_tag,
     "nocumulate" => \$nocumulate,
+    "max-retry-times=s" => \$max_retry_times,
     );
 
 if ( $help ) {
@@ -2103,6 +2105,9 @@ sub build_package {
     if ($nocumulate) {
         push @args, "--nocumulate";
     }
+    if ($max_retry_times > 0) {
+        push @args, "--max-retry-times=$max_retry_times";
+    }
     my $redirect = "";
     if ($MAX_THREADS > 1 ) {
         $redirect = "> /dev/null 2>&1";