diff -Nru dpkg-1.22.0ubuntu1/debian/changelog dpkg-1.22.0ubuntu1.1/debian/changelog --- dpkg-1.22.0ubuntu1/debian/changelog 2023-08-31 20:46:40.000000000 +0000 +++ dpkg-1.22.0ubuntu1.1/debian/changelog 2024-02-23 14:56:43.000000000 +0000 @@ -1,3 +1,10 @@ +dpkg (1.22.0ubuntu1.1) mantic; urgency=medium + + [ Luca Boccassi ] + * Fix dpkg-buildpackage ignoring DEB_BUILD_PROFILES (LP: #2054741) + + -- Gianfranco Costamagna Fri, 23 Feb 2024 15:56:43 +0100 + dpkg (1.22.0ubuntu1) mantic; urgency=low * Merge from Debian unstable. Remaining changes: diff -Nru dpkg-1.22.0ubuntu1/scripts/Dpkg/BuildProfiles.pm dpkg-1.22.0ubuntu1.1/scripts/Dpkg/BuildProfiles.pm --- dpkg-1.22.0ubuntu1/scripts/Dpkg/BuildProfiles.pm 2023-08-30 17:09:03.000000000 +0000 +++ dpkg-1.22.0ubuntu1.1/scripts/Dpkg/BuildProfiles.pm 2024-02-23 14:56:36.000000000 +0000 @@ -81,6 +81,11 @@ my (@profiles) = @_; $cache_profiles = 1; + # This is called from dpkg-buildpackage.pl unconditionally. If no profile + # was passed from the command line, check the environment variable. + if (!@profiles && Dpkg::BuildEnv::has('DEB_BUILD_PROFILES')) { + @profiles = split ' ', Dpkg::BuildEnv::get('DEB_BUILD_PROFILES'); + } @build_profiles = @profiles; run_vendor_hook('update-buildprofiles', \@build_profiles); Dpkg::BuildEnv::set('DEB_BUILD_PROFILES', join ' ', @build_profiles); diff -Nru dpkg-1.22.0ubuntu1/scripts/t/Dpkg_BuildProfiles.t dpkg-1.22.0ubuntu1.1/scripts/t/Dpkg_BuildProfiles.t --- dpkg-1.22.0ubuntu1/scripts/t/Dpkg_BuildProfiles.t 2023-08-31 20:44:14.000000000 +0000 +++ dpkg-1.22.0ubuntu1.1/scripts/t/Dpkg_BuildProfiles.t 2024-02-23 14:56:20.000000000 +0000 @@ -16,7 +16,7 @@ use strict; use warnings; -use Test::More tests => 10; +use Test::More tests => 11; BEGIN { use_ok('Dpkg::BuildProfiles', qw(parse_build_profiles @@ -71,3 +71,14 @@ set_build_profiles(qw(!noudeb nocheck stage1)); is_deeply([ get_build_profiles() ], [ qw(nocheck stage1) ], 'get active build profiles explicitly set'); + +{ + local $ENV{DEB_BUILD_PROFILES} = 'cross nodoc profile.name'; + + # dpkg-buildpackage.pl calls set_build_profiles with an empty array by + # default (unless --build-profiles is used), ensure the env var is still + # parsed + set_build_profiles(qw()); + is_deeply([ get_build_profiles() ], [ qw(noudeb cross nodoc profile.name) ], + 'get active build profiles from environment'); +} File /tmp/tmpyryoe4pl/TzXm88Yi4Q/dpkg-1.22.0ubuntu1/tests/t-unpack-fifo/pkg-fifo/test-fifo is a fifo while file /tmp/tmpyryoe4pl/l5QgMslkRK/dpkg-1.22.0ubuntu1.1/tests/t-unpack-fifo/pkg-fifo/test-fifo is a fifo File /tmp/tmpyryoe4pl/TzXm88Yi4Q/dpkg-1.22.0ubuntu1/tests/t-unpack-hardlink/pkg-hardlink/test-fifo-link0 is a fifo while file /tmp/tmpyryoe4pl/l5QgMslkRK/dpkg-1.22.0ubuntu1.1/tests/t-unpack-hardlink/pkg-hardlink/test-fifo-link0 is a fifo File /tmp/tmpyryoe4pl/TzXm88Yi4Q/dpkg-1.22.0ubuntu1/tests/t-unpack-hardlink/pkg-hardlink/test-fifo-link1 is a fifo while file /tmp/tmpyryoe4pl/l5QgMslkRK/dpkg-1.22.0ubuntu1.1/tests/t-unpack-hardlink/pkg-hardlink/test-fifo-link1 is a fifo