[Reproducible-commits] [dpkg] 01/02: Dpkg::Arch: Fix value caching by not shadowing the variables

Holger Levsen holger at layer-acht.org
Tue May 3 08:43:40 UTC 2016


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to annotated tag 1.16.12
in repository dpkg.

commit 8dafb822bb93de1ababd850360844986c9e0e900
Author: Guillem Jover <guillem at debian.org>
Date:   Tue Jan 1 19:30:36 2013 +0100

    Dpkg::Arch: Fix value caching by not shadowing the variables
    
    Cherry picked from commit a64bfa733075a7140193f5a4b9d4292234dd230e.
    
    The effect of not caching the values has a severe impact on
    performance on code repeatedly calling (directly or indirectly)
    the get_raw_build_arch() and get_raw_host_arch() functions.
    
    Addresses Variables::ProhibitReusedNames.
    
    Closes: #724949
---
 debian/changelog     | 7 +++++++
 scripts/Dpkg/Arch.pm | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index a8c0c87..c168a63 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+dpkg (1.16.12) UNRELEASED; urgency=low
+
+  * Fix value caching in Dpkg::Arch by not shadowing the variables.
+    Closes: #724949
+
+ -- Guillem Jover <guillem at debian.org>  Mon, 30 Sep 2013 16:48:50 +0200
+
 dpkg (1.16.11) stable; urgency=low
 
   [ Raphaël Hertzog ]
diff --git a/scripts/Dpkg/Arch.pm b/scripts/Dpkg/Arch.pm
index bfc19f4..bfee423 100644
--- a/scripts/Dpkg/Arch.pm
+++ b/scripts/Dpkg/Arch.pm
@@ -59,7 +59,7 @@ my %debarch_to_debtriplet;
 	# dpkg-architecture itself, by avoiding computing the DEB_BUILD_
 	# variables when they are not requested.
 
-	my $build_arch = `dpkg --print-architecture`;
+	$build_arch = `dpkg --print-architecture`;
 	syserr("dpkg --print-architecture failed") if $? >> 8;
 
 	chomp $build_arch;
@@ -75,7 +75,7 @@ my %debarch_to_debtriplet;
     {
 	return $gcc_host_gnu_type if defined $gcc_host_gnu_type;
 
-	my $gcc_host_gnu_type = `\${CC:-gcc} -dumpmachine`;
+	$gcc_host_gnu_type = `\${CC:-gcc} -dumpmachine`;
 	if ($? >> 8) {
 	    $gcc_host_gnu_type = '';
 	} else {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list