aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <dev@blino.org>2016-11-24 13:27:09 +0000
committerPascal Terjan <pterjan@gmail.com>2016-11-24 13:27:09 +0000
commite25899465808ac13ed6ce60ef6dccb0b932f9337 (patch)
tree67d7867047dfa8bd65a15e7827bb653a580a2a50
parent5df7c6f90fd6ad53df1ad39e2ea383be543f4ba1 (diff)
downloadiurt-e25899465808ac13ed6ce60ef6dccb0b932f9337.tar
iurt-e25899465808ac13ed6ce60ef6dccb0b932f9337.tar.gz
iurt-e25899465808ac13ed6ce60ef6dccb0b932f9337.tar.bz2
iurt-e25899465808ac13ed6ce60ef6dccb0b932f9337.tar.xz
iurt-e25899465808ac13ed6ce60ef6dccb0b932f9337.zip
Extract get_target_arch helper
-rw-r--r--lib/Iurt/Config.pm7
-rw-r--r--lib/Iurt/Emi.pm2
-rw-r--r--lib/Iurt/Queue.pm2
-rwxr-xr-xulri7
4 files changed, 12 insertions, 6 deletions
diff --git a/lib/Iurt/Config.pm b/lib/Iurt/Config.pm
index 3bef604..c8250f8 100644
--- a/lib/Iurt/Config.pm
+++ b/lib/Iurt/Config.pm
@@ -21,6 +21,7 @@ our @EXPORT = qw(
check_noarch
get_package_prefix
get_mandatory_arch
+ get_target_arch
%arch_comp
);
@@ -187,4 +188,10 @@ sub get_mandatory_arch {
(ref($config->{mandatory_arch}) eq 'HASH' ? ($config->{mandatory_arch}{$target}, $config->{mandatory_arch}{default}) : ()), [];
}
+sub get_target_arch {
+ my ($config, $target) = @_;
+ find { ref($_) eq 'ARRAY' } $config->{arch},
+ (ref($config->{arch}) eq 'HASH' ? ($config->{arch}{$target}, $config->{arch}{default}) : ()), [ keys %{$config->{bot}} ];
+}
+
1;
diff --git a/lib/Iurt/Emi.pm b/lib/Iurt/Emi.pm
index 569024c..284ea2d 100644
--- a/lib/Iurt/Emi.pm
+++ b/lib/Iurt/Emi.pm
@@ -2,7 +2,7 @@ package Iurt::Emi;
use base qw(Exporter);
use File::Path qw(make_path);
-use Iurt::Config qw(get_author_email get_mandatory_arch);
+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);
diff --git a/lib/Iurt/Queue.pm b/lib/Iurt/Queue.pm
index d065713..3fc40bd 100644
--- a/lib/Iurt/Queue.pm
+++ b/lib/Iurt/Queue.pm
@@ -3,7 +3,7 @@ package Iurt::Queue;
use base qw(Exporter);
use File::Copy 'move';
use File::Path 'make_path';
-use Iurt::Config qw(get_mandatory_arch);
+use Iurt::Config qw(get_mandatory_arch get_target_arch);
use Iurt::File qw(read_line);
use Iurt::Util qw(plog);
use MDK::Common qw(cat_ find member partition);
diff --git a/ulri b/ulri
index b53c9a4..07c793a 100755
--- a/ulri
+++ b/ulri
@@ -33,7 +33,7 @@
use strict;
use MDK::Common qw(any cat_ if_ find);
-use Iurt::Config qw(config_usage get_date config_init get_author_email check_arch check_noarch);
+use Iurt::Config qw(config_usage get_date config_init get_author_email check_arch check_noarch get_target_arch);
use Iurt::File qw(create_file);
use Iurt::Process qw(check_pid);
use Iurt::Queue qw(check_if_mandatory_arch_failed cleanup_failed_build get_upload_tree_state);
@@ -492,10 +492,9 @@ foreach my $prefix (sort keys %pkg_tree) {
next if $pkg_tree{$prefix}{media}{$media}{arch}{noarch};
next if $pkg_tree{$prefix}{media}{$media}{done_arch}{noarch};
- my $arch_list = find { ref($_) eq 'ARRAY' } $config->{arch}, (ref($config->{arch}) eq 'HASH' ? ($config->{arch}{$target}, $config->{arch}{default}) : ());
- my @arch_list = $arch_list ? @$arch_list : keys %{$config->{bot}};
+ my $arch_list = get_target_arch($config, $target);
# need to find a bot for each arch
- foreach my $arch (@arch_list) {
+ foreach my $arch (@$arch_list) {
# Skip this arch if the package is already building for it or if it
# should not be built on this arch or it has already failed or
# succeeded.