Sfoglia il codice sorgente

Fix dpkg-buildpackage to not double options when called with -j option

* scripts/Dpkg/BuildOptions.pm (set): Change the default value of
the overwrite parameter to 1. The only use of this function in
dpkg-buildpackage is missing the parameter and actually wants to
overwrite the whole variable.
* scripts/t/300_Dpkg_BuildOptions.t: Adjust the test suite for this
change.
Raphael Hertzog 18 anni fa
parent
commit
8dce023c26
4 ha cambiato i file con 12 aggiunte e 1 eliminazioni
  1. 7 0
      ChangeLog
  2. 3 0
      debian/changelog
  3. 1 0
      scripts/Dpkg/BuildOptions.pm
  4. 1 1
      scripts/t/300_Dpkg_BuildOptions.t

+ 7 - 0
ChangeLog

@@ -6,6 +6,13 @@
 	They are initialized by the loader with values searched in the
 	needed libraries.
 
+	* scripts/Dpkg/BuildOptions.pm (set): Change the default value of
+	the overwrite parameter to 1. The only use of this function in
+	dpkg-buildpackage is missing the parameter and actually wants to
+	overwrite the whole variable.
+	* scripts/t/300_Dpkg_BuildOptions.t: Adjust the test suite for this
+	change.
+
 2008-01-04  Raphael Hertzog  <hertzog@debian.org>
 
 	* scripts/Dpkg/Shlibs/SymbolFile.pm: Replace #DEPRECATED by

+ 3 - 0
debian/changelog

@@ -17,6 +17,9 @@ dpkg (1.14.15) UNRELEASED; urgency=low
   * Explain better the order in which postinst/prerm scripts are called
     between a package and its dependencies. Thanks to Nicolas François and
     Helge Kreutzmann for their suggestions. Closes: #379641
+  * Fix Dpkg::BuildOptions so that dpkg-buildpackage doesn't double all
+    options in DEB_BUILD_OPTIONS when called with the -j parameter.
+    Closes: #453656
 
   [ Guillem Jover ]
   * Move compression related variables to a new Dpkg::Compression module.

+ 1 - 0
scripts/Dpkg/BuildOptions.pm

@@ -23,6 +23,7 @@ sub parse {
 
 sub set {
     my ($opts, $overwrite) = @_;
+    $overwrite = 1 if not defined($overwrite);
 
     my $env = $overwrite ? '' : $ENV{DEB_BUILD_OPTIONS}||'';
     if ($env) { $env .= ',' }

+ 1 - 1
scripts/t/300_Dpkg_BuildOptions.t

@@ -37,5 +37,5 @@ is_deeply(Dpkg::BuildOptions::parse(), $dbo, 'set (env)');
 
 $ENV{DEB_BUILD_OPTIONS} = 'foobar';
 $dbo = { noopt => '' };
-$env = Dpkg::BuildOptions::set($dbo);
+$env = Dpkg::BuildOptions::set($dbo, 0);
 is($env, "foobar,noopt,", 'set (append)');