From: Guillem Jover Date: Sun, 4 Nov 2007 00:05:14 +0000 (+0200) Subject: Dpkg::Arch: Instead of printing make get_valid_arches return an array X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd1ce010c0aa39dd4b030527c2c23f2df6bea6c1;p=dpkg Dpkg::Arch: Instead of printing make get_valid_arches return an array --- diff --git a/ChangeLog b/ChangeLog index da778b5a..c46d2c9a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-11-04 Guillem Jover + + * scripts/Dpkg/Arch.pm (get_valid_arches): Return an array instead of + printing the architectures. + 2007-10-18 Raphael Hertzog * scripts/Dpkg/Deps.pm: new module to handle dependencies, to diff --git a/scripts/Dpkg/Arch.pm b/scripts/Dpkg/Arch.pm index 3cf7e4dd..7ffca35b 100644 --- a/scripts/Dpkg/Arch.pm +++ b/scripts/Dpkg/Arch.pm @@ -38,12 +38,16 @@ sub get_valid_arches() read_cputable() if (!@cpu); read_ostable() if (!@os); + my @arches; + foreach my $os (@os) { foreach my $cpu (@cpu) { my $arch = debtriplet_to_debarch(split(/-/, $os, 2), $cpu); - print $arch."\n" if defined($arch); + push @arches, $arch if defined($arch); } } + + return @arches; } sub read_cputable