Browse Source

Dpkg::Arch: Support debarch_to_debtuple returning a hash references

Guillem Jover 9 years ago
parent
commit
15f36bee2a
1 changed files with 8 additions and 1 deletions
  1. 8 1
      scripts/Dpkg/Arch.pm

+ 8 - 1
scripts/Dpkg/Arch.pm

@@ -405,7 +405,14 @@ sub debarch_to_debtuple($)
     my $tuple = $debarch_to_debtuple{$arch};
 
     if (defined($tuple)) {
-	return split(/-/, $tuple, 4);
+        my @tuple = split /-/, $tuple, 4;
+        return @tuple if wantarray;
+        return {
+            abi => $tuple[0],
+            libc => $tuple[1],
+            os => $tuple[2],
+            cpu => $tuple[3],
+        };
     } else {
 	return;
     }