aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <dev@blino.org>2015-11-08 23:38:29 +0100
committerOlivier Blin <dev@blino.org>2015-11-17 00:21:57 +0100
commitdfd2c3cf46e77d85ff3a1b186dd5b15ad16ecb27 (patch)
treee7b3d6b0ac5b307ef1b5cf5ab8180491badf13ac
parentc04a6b6684c17dacbe279b3f4c2f1ffeb9695e4c (diff)
downloadiurt-dfd2c3cf46e77d85ff3a1b186dd5b15ad16ecb27.tar
iurt-dfd2c3cf46e77d85ff3a1b186dd5b15ad16ecb27.tar.gz
iurt-dfd2c3cf46e77d85ff3a1b186dd5b15ad16ecb27.tar.bz2
iurt-dfd2c3cf46e77d85ff3a1b186dd5b15ad16ecb27.tar.xz
iurt-dfd2c3cf46e77d85ff3a1b186dd5b15ad16ecb27.zip
emi: Do not reupload src/noarch packages with non-mandatory arches if already uploaded before
-rwxr-xr-xemi16
1 files changed, 13 insertions, 3 deletions
diff --git a/emi b/emi
index 9a1096f..fa1d66e 100755
--- a/emi
+++ b/emi
@@ -264,7 +264,7 @@ foreach my $prefix (sort keys %pkg_tree) {
sub upload_prefix_in_section {
my ($prefix, $section, $o_finish) = @_;
- my @packages;
+ my (@packages, @duplicate_packages);
my ($user) = $prefix =~ /\d{14}\.(\w+)\.\w+\.\d+$/;
my $target = $pkg_tree{$prefix}{target};
@@ -272,7 +272,17 @@ sub upload_prefix_in_section {
plog('OK', "all mandatory archs done: $prefix");
foreach my $rpm (@{$pkg_tree{$prefix}{section}{$section}{rpms}}) {
- push @packages, "$done/$path/${prefix}_$rpm";
+ my $rpmpath = "$done/$path/${prefix}_$rpm";
+ if ($uploaded{$prefix}{$section}) {
+ # if already uploaded for mandatory arches, do not try to upload again src or noarch packages
+ # but still remember these duplicate files for removal
+ if (my ($type) = $rpm =~ /\.(noarch|src)\.rpm$/) {
+ plog('DEBUG', "$prefix already uploaded for mandatory arches, not re-uploading $type $rpm");
+ push @duplicate_packages, $rpmpath;
+ next;
+ }
+ }
+ push @packages, $rpmpath;
plog('OK', " uploading $rpm in $done/$path");
}
@@ -308,7 +318,7 @@ sub upload_prefix_in_section {
}
# delete the files which should have heen either put in queue or rejected
- unlink(@packages);
+ unlink(@packages, @duplicate_packages);
# unlink the sources rpm unless some non mandatory arch still need to be done
my $all_done = 1;