aboutsummaryrefslogtreecommitdiffstats
path: root/emi
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@gmail.com>2015-11-08 18:01:04 +0000
committerPascal Terjan <pterjan@gmail.com>2015-11-16 23:00:49 +0000
commit5c54fa4c92a717168d6af76819bb4cd178946e1f (patch)
tree94facaad08f51c784dcbe508cdf0a599a4d5de61 /emi
parentde993d5cdeefc7cdcaaf5f5885936669df21bc89 (diff)
downloadiurt-5c54fa4c92a717168d6af76819bb4cd178946e1f.tar
iurt-5c54fa4c92a717168d6af76819bb4cd178946e1f.tar.gz
iurt-5c54fa4c92a717168d6af76819bb4cd178946e1f.tar.bz2
iurt-5c54fa4c92a717168d6af76819bb4cd178946e1f.tar.xz
iurt-5c54fa4c92a717168d6af76819bb4cd178946e1f.zip
Keep src.rpm until all archs are done
Diffstat (limited to 'emi')
-rwxr-xr-xemi28
1 files changed, 19 insertions, 9 deletions
diff --git a/emi b/emi
index 1ee4cba..0b127e6 100755
--- a/emi
+++ b/emi
@@ -253,7 +253,7 @@ sub upload_prefix_in_section {
my $path = $pkg_tree{$prefix}{section}{$section}{path};
- plog('OK', "all archs done: $prefix");
+ plog('OK', "all mandatory archs done: $prefix");
foreach my $rpm (@{$pkg_tree{$prefix}{section}{$section}{rpms}}) {
push @packages, "$done/$path/${prefix}_$rpm";
plog('OK', " uploading $rpm in $done/$path");
@@ -293,14 +293,24 @@ sub upload_prefix_in_section {
# delete the files which should have heen either put in queue or rejected
unlink(@packages);
- # keep the log file for debugging
- # unlink("$done/$path/$prefix.youri");
-
- # unlink the sources rpm, other arch will be able to grab it into
- # the repository
- foreach (@{$pkg_tree{$prefix}{todo}}) {
- plog('DEBUG', "unlink $todo/$path/${prefix}_$_");
- unlink("$todo/$path/${prefix}_$_");
+ # unlink the sources rpm unless some non mandatory arch still need to be done
+ my $all_done = 1;
+ if (!defined($pkg_tree{$prefix}{section}{$section}{arch}{noarch})) {
+ my $arch_list = find { ref($_) eq 'ARRAY' } $config->{arch}, (ref($config->{arch}) eq 'HASH' ? ($config->{arch}{$target}, $config->{arch}{default}) : ());
+ my @arch_list = $arch_list ? @$arch_list : keys %{$config->{bot}};
+ # If we are here, mandatory arches are done, no need to check them
+ my $mandatory_arch = find { ref($_) eq 'ARRAY' } $config->{mandatory_arch},
+ (ref($config->{mandatory_arch}) eq 'HASH' ? ($config->{mandatory_arch}{$target}, $config->{mandatory_arch}{default}) : ()), [];
+ foreach my $arch (difference2(@arch_list, $mandatory_arch)) {
+ next if $pkg_tree{$prefix}{section}{$section}{arch}{$arch};
+ $all_done = 0;
+ }
+ }
+ if ($all_done) {
+ foreach (@{$pkg_tree{$prefix}{todo}}) {
+ plog('DEBUG', "unlink $todo/$path/${prefix}_$_");
+ unlink("$todo/$path/${prefix}_$_");
+ }
}
}