aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Iurt/Emi.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Iurt/Emi.pm')
-rw-r--r--lib/Iurt/Emi.pm26
1 files changed, 23 insertions, 3 deletions
diff --git a/lib/Iurt/Emi.pm b/lib/Iurt/Emi.pm
index 851307c..bf76a64 100644
--- a/lib/Iurt/Emi.pm
+++ b/lib/Iurt/Emi.pm
@@ -6,12 +6,14 @@ use Iurt::Config qw(get_author_email get_mandatory_arch get_target_arch);
use Iurt::Mail qw(sendmail);
use Iurt::Queue qw(check_if_all_archs_processed);
use Iurt::Util qw(plog);
+use MDK::Common::File qw(touch);
use MDK::Common::Func qw(find);
use MDK::Common::DataStructure qw(difference2);
use strict;
our @EXPORT = qw(
find_prefixes_ready_to_upload
+ record_uploaded_packages
upload_prefix_in_media
);
@@ -150,11 +152,10 @@ sub upload_prefix_in_media {
plog('OK', " uploading $rpm in $done/$path");
}
- # This should not happen :(
+ # When a package is not marked as noarch but only has noarch subpackages, there will be nothing
+ # left to upload when it finishes building on non mandaory arch.
return unless @packages;
- $user ||= $config->{upload_user};
-
my $command = generate_upload_command($prefix, $media, $target, $user, \@packages, $o_finish, "$done$path/$youri_file");
plog('DEBUG', "running $command");
if (!system($command)) {
@@ -193,3 +194,22 @@ sub upload_prefix_in_media {
}
}
}
+
+sub record_uploaded_packages {
+ my ($config, $pkg_tree, $prefix, $media) = @_;
+ my $done = "$config->{queue}/done";
+ my $path = $pkg_tree->{$prefix}{media}{$media}{path};
+
+ my %arches;
+ foreach my $pkg (@{$pkg_tree->{$prefix}{media}{$media}{rpms}}) {
+ my ($arch) = $pkg =~ /\.([^.]*)\.rpm$/;
+ $arches{$arch} = 1 unless $arch eq 'src';
+ }
+ # Only keep noarch if it's the only architecture
+ delete $arches{'noarch'} if 1 < keys %arches;
+
+ foreach my $arch (keys %arches) {
+ touch("$done/$path/${prefix}_$arch.uploaded");
+ }
+ touch("$done/$path/$prefix.upload");
+}