From e9c97a7a64695b2ccb40f0be8303c542ed3b239b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 9 May 2010 11:45:35 -0400 Subject: Drop one more call to dpkg-architecture. Closes: #580837 (Raphael Geissert) --- Debian/Debhelper/Dh_Lib.pm | 22 +++++++++++++++++----- debian/changelog | 7 +++++++ 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm index 421dd996..7c12706a 100644 --- a/Debian/Debhelper/Dh_Lib.pm +++ b/Debian/Debhelper/Dh_Lib.pm @@ -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 () { + my ($k, $v) = split(/=/); + chomp $v; + $dpkg_arch_output{$k} = $v; + } + close(PIPE); + } + return $dpkg_arch_output{$var}; + } } # Returns the build architecture. (Memoized) diff --git a/debian/changelog b/debian/changelog index 4bcdd644..aea7bfc8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (7.4.20) UNRELEASED; urgency=low + + * Drop one more call to dpkg-architecture. Closes: #580837 + (Raphael Geissert) + + -- Joey Hess Sun, 09 May 2010 11:44:58 -0400 + debhelper (7.4.19) unstable; urgency=low * Memoize architecture comparisons in samearch, and avoid calling -- cgit v1.2.3