summaryrefslogtreecommitdiff
path: root/Debian
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2015-07-24 05:35:18 +0200
committerNiels Thykier <niels@thykier.net>2015-07-25 20:17:19 +0200
commit8b314a6659b26f11721680656ead634c673ca801 (patch)
tree0afe8ed744ee7fc2bd6e62b51ca142b073a72f0d /Debian
parentc84d3b5b39a5dd82becc534af73fa180bf5aaed5 (diff)
downloaddebhelper-8b314a6659b26f11721680656ead634c673ca801.tar.gz
Dh_Lib: Try to use dpkg-architecture variables from the environment
This should avoid quite costly calls to dpkg-architecture, when the user has preinitialized them either through dpkg-buildpackage or «dpkg-architecture -c debian/rules binary» for example. Signed-off-by: Guillem Jover <guillem@debian.org> Signed-off-by: Niels Thykier <niels@thykier.net>
Diffstat (limited to 'Debian')
-rw-r--r--Debian/Debhelper/Dh_Lib.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index f1953675..387f90a1 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -763,7 +763,10 @@ sub excludefile {
my %dpkg_arch_output;
sub dpkg_architecture_value {
my $var = shift;
- if (! exists($dpkg_arch_output{$var})) {
+ if (exists($ENV{$var})) {
+ return $ENV{$var};
+ }
+ elsif (! exists($dpkg_arch_output{$var})) {
local $_;
open(PIPE, '-|', 'dpkg-architecture')
or error("dpkg-architecture failed");