aboutsummaryrefslogtreecommitdiffstats
path: root/ulri
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@gmail.com>2014-04-13 22:40:30 +0000
committerPascal Terjan <pterjan@gmail.com>2014-04-18 13:04:05 +0000
commitd44f5f322cdec614765763a28d7c475c06f9ba31 (patch)
treeb68a99b90a727a374bb9d9928d627df32bd320a1 /ulri
parentddf4f3f2a50d2f9f5aabd2ab0a9a96cee4df8412 (diff)
downloadiurt-d44f5f322cdec614765763a28d7c475c06f9ba31.tar
iurt-d44f5f322cdec614765763a28d7c475c06f9ba31.tar.gz
iurt-d44f5f322cdec614765763a28d7c475c06f9ba31.tar.bz2
iurt-d44f5f322cdec614765763a28d7c475c06f9ba31.tar.xz
iurt-d44f5f322cdec614765763a28d7c475c06f9ba31.zip
Add a way to have a build waiting for others.
This is a list of prefix, so if one of the builds fails dependent ones will be rejected. It would be nicer for a user perspective to specify that we want to wait for the src.rpm of foo >= XX.YY to be available, with some time limit, as it would get built if the original build fails but get submitted again, but that would be much more complicated to implement. This simple solution allows a Youri::Submit action to submit build of dependant packages while the upload is not finished yet. For example this will allow to automatically rebuild kmod-* and drakx-installer-images after a new kernel is uploaded.
Diffstat (limited to 'ulri')
-rwxr-xr-xulri47
1 files changed, 47 insertions, 0 deletions
diff --git a/ulri b/ulri
index 45d48da..5787fc6 100755
--- a/ulri
+++ b/ulri
@@ -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};