Просмотр исходного кода

Dpkg::Arch: Instead of printing make get_valid_arches return an array

Guillem Jover лет назад: 18
Родитель
Сommit
cd1ce010c0
2 измененных файлов с 10 добавлено и 1 удалено
  1. 5 0
      ChangeLog
  2. 5 1
      scripts/Dpkg/Arch.pm

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+2007-11-04  Guillem Jover  <guillem@debian.org>
+
+	* scripts/Dpkg/Arch.pm (get_valid_arches): Return an array instead of
+	printing the architectures.
+
 2007-10-18  Raphael Hertzog  <hertzog@debian.org>
 
 	* scripts/Dpkg/Deps.pm: new module to handle dependencies, to

+ 5 - 1
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