summaryrefslogtreecommitdiff
path: root/Debian/Debhelper/Dh_Lib.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-05-09 11:45:35 -0400
committerJoey Hess <joey@kitenet.net>2010-05-09 11:45:35 -0400
commite9c97a7a64695b2ccb40f0be8303c542ed3b239b (patch)
tree50de5b5b23181e871a10571b4ab6c5e2b52fc97a /Debian/Debhelper/Dh_Lib.pm
parentb465ddcb0a7c540497ae44e373b7d50caecc0a8d (diff)
Drop one more call to dpkg-architecture. Closes: #580837 (Raphael Geissert)
Diffstat (limited to 'Debian/Debhelper/Dh_Lib.pm')
-rw-r--r--Debian/Debhelper/Dh_Lib.pm22
1 files changed, 17 insertions, 5 deletions
diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index 421dd99..7c12706 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 (<PIPE>) {
+ my ($k, $v) = split(/=/);
+ chomp $v;
+ $dpkg_arch_output{$k} = $v;
+ }
+ close(PIPE);
+ }
+ return $dpkg_arch_output{$var};
+ }
}
# Returns the build architecture. (Memoized)