Просмотр исходного кода

Dpkg::Arch: Fix value caching by not shadowing the variables

Addresses Variables::ProhibitReusedNames.
Guillem Jover лет назад: 13
Родитель
Сommit
a64bfa7330
2 измененных файлов с 3 добавлено и 2 удалено
  1. 1 0
      debian/changelog
  2. 2 2
      scripts/Dpkg/Arch.pm

+ 1 - 0
debian/changelog

@@ -130,6 +130,7 @@ dpkg (1.17.0) UNRELEASED; urgency=low
   * Change dpkg and dpkg-deb help output to recommend apt instead of dselect
     as a user-friendly frontend.
   * Remove temporary file on error during «dpkg-divert --rename».
+  * Fix value caching in Dpkg::Arch by not shadowing the variables.
 
   [ Updated programs translations ]
   * Fix typo in Spanish translation of update-alternatives.

+ 2 - 2
scripts/Dpkg/Arch.pm

@@ -60,7 +60,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;
@@ -76,7 +76,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 {