From 2cafdf6269c73d980f5a6491fccc321e101283d6 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Sun, 8 Nov 2015 23:59:29 +0100 Subject: Extract get_mandatory_arch helper --- lib/Iurt/Config.pm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') diff --git a/lib/Iurt/Config.pm b/lib/Iurt/Config.pm index a1a1e84..7b07d7a 100644 --- a/lib/Iurt/Config.pm +++ b/lib/Iurt/Config.pm @@ -20,6 +20,7 @@ our @EXPORT = qw( check_arch check_noarch get_package_prefix + get_mandatory_arch %arch_comp ); @@ -180,4 +181,10 @@ sub check_arch { return 1; } +sub get_mandatory_arch { + my ($config, $target) = @_; + find { ref($_) eq 'ARRAY' } $config->{mandatory_arch}, + (ref($config->{mandatory_arch}) eq 'HASH' ? ($config->{mandatory_arch}{$target}, $config->{mandatory_arch}{default}) : ()), []; +} + 1; -- cgit v1.2.1