aboutsummaryrefslogtreecommitdiffstats
path: root/ulri
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2022-04-25 14:10:47 +0000
committerPascal Terjan <pterjan@mageia.org>2022-04-25 14:16:06 +0000
commit1be1c9d62000e1fa7aedce432957e379bdeb305c (patch)
treec8b1d0a20ca197113d905ada014423035d963e47 /ulri
parent9834b77b7a810dffd2bc661bb926e8a1d8696878 (diff)
downloadiurt-1be1c9d62000e1fa7aedce432957e379bdeb305c.tar
iurt-1be1c9d62000e1fa7aedce432957e379bdeb305c.tar.gz
iurt-1be1c9d62000e1fa7aedce432957e379bdeb305c.tar.bz2
iurt-1be1c9d62000e1fa7aedce432957e379bdeb305c.tar.xz
iurt-1be1c9d62000e1fa7aedce432957e379bdeb305c.zip
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.
Diffstat (limited to 'ulri')
-rwxr-xr-xulri41
1 files changed, 19 insertions, 22 deletions
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);