From 1be1c9d62000e1fa7aedce432957e379bdeb305c Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Mon, 25 Apr 2022 14:10:47 +0000 Subject: ulri: rely on status.log to know a build completed This will fix packages not marked as noarch but having only noarch subpackages, even if we still end up wasting resources. The only risk I see is if the noarch packages get built on all mandatory architectures first, upload starts and other architectures complete in hte middle, however this should not modify the files being uploaded, we use a temporary file and rename so it should be fine. --- ulri | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) (limited to 'ulri') diff --git a/ulri b/ulri index 7f61efb..aa6bf1f 100755 --- a/ulri +++ b/ulri @@ -322,6 +322,7 @@ foreach my $prefix (keys %pkg_tree) { my $fail; my $later; + my $done; # Check if the build bot finished on the other side # @@ -338,18 +339,20 @@ foreach my $prefix (keys %pkg_tree) { if ($r ne 'ok') { plog('FAIL', "$r: $p"); $fail = 1; + } else { + plog('OK', "build complete: $p"); + $done = 1; } } - if (!$fail && !$later) { + if ($done) { my @list = split "\n", sout($remote, "ls $prefix_dir"); my $error; - my $done; my $arch_check = join '|', $arch, if_($untranslated_arch{$arch}, @{$untranslated_arch{$arch}}); plog('MSG', "checking for $arch_check arch"); foreach my $result (@list) { - $result =~ /\.(src|$arch_check|noarch)\.rpm$/ or next; + $result =~ /\.rpm$/ or next; # do not copy the initial src package $result =~ /^$prefix/ and next; @@ -357,10 +360,6 @@ foreach my $prefix (keys %pkg_tree) { my $result_file = "$done_dir/${prefix}_$result"; plog('OK', "build ok: $result"); - if ($result =~ /\.$arch_check\.rpm$/) { - $done = 1; - } - plog('DEBUG', "copy files to done"); make_path($done_dir); if (sget($remote, "$prefix_dir/$result", @@ -378,22 +377,20 @@ foreach my $prefix (keys %pkg_tree) { } next if $error; - if ($done) { - if (check_if_mandatory_arch_failed($media, $ent, $config)) { - # Discard this arch as another mandatory one failed - cleanup_failed_build($todo_dir, $done_dir, $fail_dir, $prefix, $ent, $media, $arch, $config); - } else { - create_file("$done_dir/${prefix}_$arch.done", "$bot $host"); - $pkg_tree{$prefix}{media}{$media}{done_arch}{$arch} = 1; - make_path("$done_dir/$prefix"); - sget($remote, "$prefix_dir/log/*", "$done_dir/$prefix"); - $something_finished = 1; - } - # Either we already fetched the success logs, or don't care - # as this success was discarded due to another failure. - ssh($remote, "rm -rf $prefix_dir"); - next bot; + if (check_if_mandatory_arch_failed($media, $ent, $config)) { + # Discard this arch as another mandatory one failed + cleanup_failed_build($todo_dir, $done_dir, $fail_dir, $prefix, $ent, $media, $arch, $config); + } else { + create_file("$done_dir/${prefix}_$arch.done", "$bot $host"); + $pkg_tree{$prefix}{media}{$media}{done_arch}{$arch} = 1; + make_path("$done_dir/$prefix"); + sget($remote, "$prefix_dir/log/*", "$done_dir/$prefix"); + $something_finished = 1; } + # Either we already fetched the success logs, or don't care + # as this success was discarded due to another failure. + ssh($remote, "rm -rf $prefix_dir"); + next bot; } make_path($fail_dir); -- cgit v1.2.1