diff options
Diffstat (limited to 'lib/Iurt')
-rw-r--r-- | lib/Iurt/Queue.pm | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/lib/Iurt/Queue.pm b/lib/Iurt/Queue.pm index c4c79ad..d065713 100644 --- a/lib/Iurt/Queue.pm +++ b/lib/Iurt/Queue.pm @@ -12,6 +12,7 @@ use strict; our @EXPORT = qw( get_upload_tree_state cleanup_failed_build + check_if_all_archs_processed check_if_mandatory_arch_failed ); @@ -62,8 +63,23 @@ sub check_if_mandatory_arch_failed { } } +sub check_if_all_archs_processed { + my ($media, $prefix, $ent, $config) = @_; + return 1 if $ent->{media}{$media}{done_arch}{noarch}; + return 1 if $ent->{media}{$media}{failed_arch}{noarch}; + my $arch_list = get_target_arch($config, $ent->{target}); + foreach my $arch ($arch_list) { + next if $ent->{media}{$media}{done_arch}{$arch}; + next if $ent->{media}{$media}{excluded_arch}{$arch}; + next if $ent->{media}{$media}{failed_arch}{$arch}; + # This arch is not done yet! + return; + } + return 1; +} + sub cleanup_failed_build { - my ($todo_dir, $done_dir, $fail_dir, $prefix, $ent, $arch, $config) = @_; + my ($todo_dir, $done_dir, $fail_dir, $prefix, $ent, $media, $arch, $config) = @_; my $mandatory_arch = get_mandatory_arch($config, $ent->{target}); my $fatal_failure = member($arch, @$mandatory_arch) || $arch eq 'noarch'; @@ -86,6 +102,14 @@ sub cleanup_failed_build { if (!$fatal_failure) { # keep rpms for other architectures $ent->{rpms} = $kept_rpms; + # but delete src.rpm if we are now done + if (check_if_all_archs_processed($media, $prefix, $ent, $config)) { + foreach my $srpm (@{$ent->{srpms}}) { + my $file = "$todo_dir/${prefix}_$srpm"; + plog('DEBUG', "moving $file to $fail_dir/"); + move($file, "$fail_dir/${prefix}_$srpm"); + } + } return; } |