From c5f7d5810481f12c8d876b69e0a37353bdd76c83 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 7 Dec 2012 13:38:35 +0000 Subject: simplify --- emi | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'emi') diff --git a/emi b/emi index 512e469..8357c59 100755 --- a/emi +++ b/emi @@ -192,15 +192,9 @@ foreach my $prefix (sort keys %pkg_tree) { my $ok = 1; foreach my $section (keys %{$pkg_tree{$prefix}{section}}) { - my $mandatory_arch = []; - if (ref $config->{mandatory_arch} eq 'ARRAY') { - $mandatory_arch = $config->{mandatory_arch}; - } elsif (ref $config->{mandatory_arch}->{$target} eq 'ARRAY') { - $mandatory_arch = $config->{mandatory_arch}->{$target}; - } elsif (ref $config->{mandatory_arch}->{default} eq 'ARRAY') { - $mandatory_arch = $config->{mandatory_arch}->{default}; - } - my @wanted_archs = defined($pkg_tree{$prefix}{section}{$section}{arch}{noarch}) ? 'noarch' : @{$mandatory_arch}; + my $mandatory_arch = find { ref($_) eq 'ARRAY' } $config->{mandatory_arch}, + $config->{mandatory_arch}{$target}, $config->{mandatory_arch}{default}, []; + my @wanted_archs = defined($pkg_tree{$prefix}{section}{$section}{arch}{noarch}) ? 'noarch' : @$mandatory_arch; my $path = $pkg_tree{$prefix}{section}{$section}{path}; my %missing; -- cgit v1.2.1