]> git.donarmstrong.com Git - debhelper.git/commitdiff
Drop one more call to dpkg-architecture. Closes: #580837 (Raphael Geissert)
authorJoey Hess <joey@kitenet.net>
Sun, 9 May 2010 15:45:35 +0000 (11:45 -0400)
committerJoey Hess <joey@kitenet.net>
Sun, 9 May 2010 15:45:35 +0000 (11:45 -0400)
Debian/Debhelper/Dh_Lib.pm
debian/changelog

index 421dd99647fa69f5f530493da00857d00925df02..7c12706a281d0c7c976be6231699104ff4009d3c 100644 (file)
@@ -606,11 +606,23 @@ sub excludefile {
         return 0;
 }
 
-sub dpkg_architecture_value {
-       my $var = shift;
-       my $value=`dpkg-architecture -q$var` || error("dpkg-architecture failed");
-       chomp $value;
-       return $value;
+{
+       my %dpkg_arch_output;
+       sub dpkg_architecture_value {
+               my $var = shift;
+               local $_;
+               if (!exists($dpkg_arch_output{$var})) {
+                       open(PIPE, '-|', 'dpkg-architecture')
+                               or error("dpkg-architecture failed");
+                       while (<PIPE>) {
+                               my ($k, $v) = split(/=/);
+                               chomp $v;
+                               $dpkg_arch_output{$k} = $v;
+                       }
+                       close(PIPE);
+               }
+               return $dpkg_arch_output{$var};
+       }
 }
 
 # Returns the build architecture. (Memoized)
index 4bcdd644f48682ba7b71ff709a02de00a7ee3654..aea7bfc805e95ef4ead6845ac94d18b1a6c91ba4 100644 (file)
@@ -1,3 +1,10 @@
+debhelper (7.4.20) UNRELEASED; urgency=low
+
+  * Drop one more call to dpkg-architecture. Closes: #580837
+    (Raphael Geissert)
+
+ -- Joey Hess <joeyh@debian.org>  Sun, 09 May 2010 11:44:58 -0400
+
 debhelper (7.4.19) unstable; urgency=low
 
   * Memoize architecture comparisons in samearch, and avoid calling