aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Iurt/Emi.pm25
1 files changed, 17 insertions, 8 deletions
diff --git a/lib/Iurt/Emi.pm b/lib/Iurt/Emi.pm
index 6a8ea8e..f35d0ec 100644
--- a/lib/Iurt/Emi.pm
+++ b/lib/Iurt/Emi.pm
@@ -13,6 +13,7 @@ use strict;
our @EXPORT = qw(
find_prefixes_ready_to_upload
+ record_uploaded_packages
upload_prefix_in_media
);
@@ -160,14 +161,6 @@ 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/");
@@ -202,3 +195,19 @@ 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$/;
+ $arches{$arch} = 1 unless $arch eq 'src';
+ }
+ # 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);
+}