aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2019-11-03 18:26:11 +0000
committerPascal Terjan <pterjan@mageia.org>2019-11-03 18:26:11 +0000
commite384f3536a6e2bc788da6a4f7b1dc322bdb8d555 (patch)
tree4fb941485415d0ce1bea6b965d72cbe761218599 /lib
parent689de43220800a71cdb80ac03b7c38fe6e0fe8e2 (diff)
downloadiurt-e384f3536a6e2bc788da6a4f7b1dc322bdb8d555.tar
iurt-e384f3536a6e2bc788da6a4f7b1dc322bdb8d555.tar.gz
iurt-e384f3536a6e2bc788da6a4f7b1dc322bdb8d555.tar.bz2
iurt-e384f3536a6e2bc788da6a4f7b1dc322bdb8d555.tar.xz
iurt-e384f3536a6e2bc788da6a4f7b1dc322bdb8d555.zip
Create one file per architecture for .upload
This is consistent with .done, .excluded, etc so allows reusing the code.
Diffstat (limited to 'lib')
-rw-r--r--lib/Iurt/Emi.pm10
-rw-r--r--lib/Iurt/Queue.pm2
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/Iurt/Emi.pm b/lib/Iurt/Emi.pm
index f35d0ec..97281ac 100644
--- a/lib/Iurt/Emi.pm
+++ b/lib/Iurt/Emi.pm
@@ -7,7 +7,6 @@ use Iurt::Mail qw(sendmail);
use Iurt::Queue qw(check_if_all_archs_processed);
use Iurt::Util qw(plog);
use MDK::Common::Func qw(find);
-use MDK::Common::File qw(append_to_file);
use MDK::Common::DataStructure qw(difference2);
use strict;
@@ -199,9 +198,8 @@ sub upload_prefix_in_media {
sub record_uploaded_packages {
my ($config, $pkg_tree, $prefix, $media) = @_;
my $done = "$config->{queue}/done";
-
- my $youri_file = "$prefix.youri";
my $path = $pkg_tree->{$prefix}{media}{$media}{path};
+
my %arches;
foreach my $pkg (@{$pkg_tree->{$prefix}{media}{$media}{rpms}}) {
my ($arch) = $pkg =~ /\.([^.]*)\.rpm$/;
@@ -209,5 +207,9 @@ sub record_uploaded_packages {
}
# Only keep noarch if it's the only architecture
delete $arches{'noarch'} if 1 < keys %arches;
- append_to_file("$done/$path/$prefix.upload", map {"$_\n"} keys %arches);
+
+ foreach my $arch (keys %arches) {
+ touch("$done/$path/$prefix_$arch.uploaded");
+ }
+ touch("$done/$path/$prefix.upload");
}
diff --git a/lib/Iurt/Queue.pm b/lib/Iurt/Queue.pm
index 3930ca4..171ff97 100644
--- a/lib/Iurt/Queue.pm
+++ b/lib/Iurt/Queue.pm
@@ -238,6 +238,8 @@ sub get_upload_tree_state {
$pkg_tree{$prefix}{media}{$media}{failed_arch}{$arch} = 1;
} elsif ($result eq 'cancelled') {
$pkg_tree{$prefix}{media}{$media}{cancelled_arch}{$arch} = 1;
+ } elsif ($result eq 'uploaded') {
+ $pkg_tree{$prefix}{media}{$media}{uploaded_arch}{$arch} = 1;
} else {
plog('WARNING', "unknown state $arch.$result for $prefix");
}