diff options
author | Pascal Terjan <pterjan@mageia.org> | 2019-11-01 21:20:12 +0000 |
---|---|---|
committer | Pascal Terjan <pterjan@mageia.org> | 2019-11-01 21:20:12 +0000 |
commit | 3a8b9560ccd568a1b1e97990a0b3da3f58b5d244 (patch) | |
tree | 1657d98fa2b5d737d4cdaecbeee83a35ff28c5f7 | |
parent | 162884bd41d51530fee5376fa661fcb1ba245c01 (diff) | |
download | iurt-3a8b9560ccd568a1b1e97990a0b3da3f58b5d244.tar iurt-3a8b9560ccd568a1b1e97990a0b3da3f58b5d244.tar.gz iurt-3a8b9560ccd568a1b1e97990a0b3da3f58b5d244.tar.bz2 iurt-3a8b9560ccd568a1b1e97990a0b3da3f58b5d244.tar.xz iurt-3a8b9560ccd568a1b1e97990a0b3da3f58b5d244.zip |
emi: store uploaded architectures in .upload
This allows to know which non mandatory architectures are done and
will allow to surface it on the web UI.
-rw-r--r-- | NEWS | 3 | ||||
-rwxr-xr-x | emi | 5 | ||||
-rw-r--r-- | lib/Iurt/Emi.pm | 9 |
3 files changed, 12 insertions, 5 deletions
@@ -1,3 +1,6 @@ +- emi: store in the .upload which architectures were uploaded to know if + non mandatory ones are done. + 0.7.8.1 - no changes, fixing bad release @@ -135,11 +135,6 @@ foreach my $target (keys %targets) { foreach my $prefix (keys %is_finisher) { upload_prefix_in_media($config, \%pkg_tree, $prefix, $media, 1); } - - foreach my $prefix (@{$targets{$target}{$media}{to_upload}}) { - my $path = $pkg_tree{$prefix}{media}{$media}{path}; - touch("$done/$path/$prefix.upload") unless -f "$reject/$path/$prefix.youri"; - } } } diff --git a/lib/Iurt/Emi.pm b/lib/Iurt/Emi.pm index 851307c..6a8ea8e 100644 --- a/lib/Iurt/Emi.pm +++ b/lib/Iurt/Emi.pm @@ -7,6 +7,7 @@ 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; @@ -159,6 +160,14 @@ sub upload_prefix_in_media { plog('DEBUG', "running $command"); if (!system($command)) { plog('INFO', "upload succeeded"); + my %arches; + foreach my $pkg (@packages) { + my ($arch) = $pkg =~ /\.([^.]*)\.rpm$/; + $arches{$arch} = 1 unless $arch eq 'src'; + } + # Only kee 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); } else { # should send a mail or something plog('ERROR', "upload failed ($!), rejecting files in $reject$path/"); |