diff options
author | Guillem Jover <guillem@debian.org> | 2015-07-24 05:35:18 +0200 |
---|---|---|
committer | Niels Thykier <niels@thykier.net> | 2015-07-25 20:17:19 +0200 |
commit | 8b314a6659b26f11721680656ead634c673ca801 (patch) | |
tree | 0afe8ed744ee7fc2bd6e62b51ca142b073a72f0d /Debian | |
parent | c84d3b5b39a5dd82becc534af73fa180bf5aaed5 (diff) | |
download | debhelper-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.pm | 5 |
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"); |