From 8dce023c264aefba0bf84a982d34401dd0e6290f Mon Sep 17 00:00:00 2001 From: Raphael Hertzog Date: Sun, 6 Jan 2008 21:21:04 +0100 Subject: [PATCH] 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. --- ChangeLog | 7 +++++++ debian/changelog | 3 +++ scripts/Dpkg/BuildOptions.pm | 1 + scripts/t/300_Dpkg_BuildOptions.t | 2 +- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 14a228cf..f17e20f1 100644 --- a/ChangeLog +++ b/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 * scripts/Dpkg/Shlibs/SymbolFile.pm: Replace #DEPRECATED by diff --git a/debian/changelog b/debian/changelog index df3aaa0f..ae3f8b32 100644 --- a/debian/changelog +++ b/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. diff --git a/scripts/Dpkg/BuildOptions.pm b/scripts/Dpkg/BuildOptions.pm index 8be98ffa..39f10997 100644 --- a/scripts/Dpkg/BuildOptions.pm +++ b/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 .= ',' } diff --git a/scripts/t/300_Dpkg_BuildOptions.t b/scripts/t/300_Dpkg_BuildOptions.t index bfd788fa..9a5baf37 100644 --- a/scripts/t/300_Dpkg_BuildOptions.t +++ b/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)'); -- 2.39.5