diff -Nru dh-exec-0.23.3/debian/changelog dh-exec-0.23.3ubuntu1/debian/changelog --- dh-exec-0.23.3/debian/changelog 2021-03-06 02:39:39.000000000 -0700 +++ dh-exec-0.23.3ubuntu1/debian/changelog 2021-03-30 10:28:56.000000000 -0600 @@ -1,3 +1,11 @@ +dh-exec (0.23.3ubuntu1) hirsute; urgency=medium + + * Fix unintended whitespace removal (LP: #1920825) Per the tests it's + desired to remove the whitespace following a build profile - such as + " B" resulting in "B", but leave lines with no build profile alone. + + -- Dan Bungert Tue, 30 Mar 2021 10:28:56 -0600 + dh-exec (0.23.3) unstable; urgency=medium * QA upload. diff -Nru dh-exec-0.23.3/debian/control dh-exec-0.23.3ubuntu1/debian/control --- dh-exec-0.23.3/debian/control 2021-03-06 02:33:27.000000000 -0700 +++ dh-exec-0.23.3ubuntu1/debian/control 2021-03-30 08:54:06.000000000 -0600 @@ -1,7 +1,8 @@ Source: dh-exec Section: devel Priority: optional -Maintainer: Debian QA Group +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Debian QA Group Build-Depends: debhelper (>= 9.20151004~), dh-autoreconf, automake (>= 1:1.11), libpipeline-dev, pkg-config, diff -Nru dh-exec-0.23.3/lib/dh-exec-filter-build-profiles dh-exec-0.23.3ubuntu1/lib/dh-exec-filter-build-profiles --- dh-exec-0.23.3/lib/dh-exec-filter-build-profiles 2016-01-02 09:17:16.000000000 -0700 +++ dh-exec-0.23.3ubuntu1/lib/dh-exec-filter-build-profiles 2021-03-30 10:26:49.000000000 -0600 @@ -36,10 +36,10 @@ } while (/<([^>]*)>/) { $line_concerned |= profile_concerned ($1, $_); - s/<([^>]*)>//; + s/<([^>]*)>\s+//; } - s/(^\s+|\s+$)//; + s/\s+$//; $_ .= "\n"; if (!$line_concerned) { diff -Nru dh-exec-0.23.3/t/test_filter.bats dh-exec-0.23.3ubuntu1/t/test_filter.bats --- dh-exec-0.23.3/t/test_filter.bats 2016-01-02 09:17:16.000000000 -0700 +++ dh-exec-0.23.3ubuntu1/t/test_filter.bats 2021-03-30 10:28:56.000000000 -0600 @@ -192,7 +192,7 @@ expect_output "this-should-do" } -@test "dh-exec-filter: Build Profiles hanles the normal build case" { +@test "dh-exec-filter: Build Profiles handles the normal build case" { if ! build_profile_support; then skip "Build profiles not supported, libdpkg-perl too old" fi @@ -206,3 +206,24 @@ expect_output "not-stage-1" ! expect_output "only-stage-1" } + +@test "dh-exec-filter: only strip leading whitespace if follows build profile" { + if ! build_profile_support; then + skip "Build profiles not supported, libdpkg-perl too old" + fi + + DEB_BUILD_PROFILES="stage1" \ + run_dh_exec_with_input .install < remove-after-profile + preserve-leading-remove-trailing + remove-after-profile-and-trailing + preserve-before-profile-remove-after-and-trailing +EOF + expect_output " preserve-leading" + expect_output "remove-after-profile" + expect_output " preserve-leading-remove-trailing" + expect_output "remove-after-profile-and-trailing" + expect_output " preserve-before-profile-remove-after-and-trailing" +}