diff options
Diffstat (limited to 'ulri')
-rwxr-xr-x | ulri | 47 |
1 files changed, 47 insertions, 0 deletions
@@ -210,6 +210,7 @@ my $compildone = {}; my $todo = "$config->{queue}/todo"; my $failure = "$config->{queue}/failure"; my $done = "$config->{queue}/done"; +my $reject = "$config->{queue}/reject"; # Raise this when the noarch package starts to build on any bot my %noarch_build; @@ -276,6 +277,20 @@ sub todo_func { 'time' => $time }; } + + if ($r =~ /(\d{14}\.\w+\.\w+\.\d+)_([\w-]+)\.(\w+)\.(\w+)\.(\d{14})\.(\d+)\.deps$/) { + my ($prefix, $arch, $bot, $host, $date, $pid) = ($1, $2, $3, $4, $5, $6); + + my @deps; + + open my $FILE, "<$todo/$f/$m/$s/$r"; + while(my $line = <$FILE>) { + chomp $line; + push @deps,$line; + } + + $pkg_tree{$prefix}{deps} = @deps; + } } sub done_func { @@ -509,6 +524,38 @@ foreach my $prefix (sort keys %pkg_tree) { next if $later{$prefix}; my $ent = $pkg_tree{$prefix}; + + my $ready = 1; + my $failed_dep = 0; + + foreach my $dep (@{$ent->{deps}}) { + if (glob "$done/*/*/*/$dep.upload") { + plog('DEBUG', "Dependent build $dep was uploaded"); + next; + } + # $dep was not uploaded yet, so it's too early to build this one + $ready = 0; + if (glob "$reject/*/*/*/$dep.youri" || glob "$done/*/*/*/${dep}_*.fail") { + plog('ERROR', "Dependent build $dep has failed"); + $failed_dep = 1; + } + } + + if ($failed_dep) { + plog('DEBUG', "Dependent build(s) failed, rejecting this one"); + foreach my $media (keys %{$ent->{media}}) { + my $path = $ent->{media}{$media}{path}; + my $target = $ent->{target}; + make_path("$reject/$path"); + foreach my $srpm (@{$ent->{srpms}}) { + move("$todo/$path/${prefix}_$srpm","$reject/$path/${prefix}_$srpm"); + } + } + next; + } + + next unless $ready; + foreach my $media (keys %{$ent->{media}}) { my $path = $ent->{media}{$media}{path}; my $target = $ent->{target}; |