This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch main in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=1901b52bb8d6fbd2479232fe8fc91fe47b1235c1 commit 1901b52bb8d6fbd2479232fe8fc91fe47b1235c1 Author: Guillem Jover <[email protected]> AuthorDate: Thu Dec 18 00:22:54 2025 +0100 Dpkg::BuildProfiles: Add workaround for callers passing invalid formulas The dh-exec tool, makes use of this module, but because the parser was not strict, it has accepted strings that were not valid build profile formulas. This is currently making packages fail to build from source. As a temporary workaround check whether the passed string is not valid, and try to fix it up by surrounding it with angle brackets. Diagnosed-by: Chris Hofstaedtler <[email protected]> --- scripts/Dpkg/BuildProfiles.pm | 6 ++++++ scripts/t/Dpkg_BuildProfiles.t | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/scripts/Dpkg/BuildProfiles.pm b/scripts/Dpkg/BuildProfiles.pm index 3678a0717..f9d4cd6c2 100644 --- a/scripts/Dpkg/BuildProfiles.pm +++ b/scripts/Dpkg/BuildProfiles.pm @@ -142,6 +142,12 @@ It will die on invalid syntax. sub parse_build_profiles($string) { + # XXX: Workaround for incorrect usage of the API in dh-exec, remove once + # the usage is fixed. + if (build_profile_is_invalid($string)) { + $string = "<$string>"; + } + if (build_profile_is_invalid($string)) { error(g_("'%s' is not a valid build profile restriction formula"), $string); diff --git a/scripts/t/Dpkg_BuildProfiles.t b/scripts/t/Dpkg_BuildProfiles.t index 7e30dd74d..2beb6a8c3 100644 --- a/scripts/t/Dpkg_BuildProfiles.t +++ b/scripts/t/Dpkg_BuildProfiles.t @@ -37,8 +37,11 @@ ok(!build_profile_is_invalid('<nocheck nodoc> <pkg/dpkg/author-checks>'), ok(build_profile_is_invalid('<invalid> + <characters>'), 'check that build profiles with invalid characters are invalid'); +TODO: { + local $TODO = 'workaround due to incorrect API uses'; ok(build_profile_is_invalid('missing angle brackets'), 'check that build profiles with missing opening/closing angle brackets are invalid'); +} ok(build_profile_is_invalid('<missing angle brackets <here too'), 'check that build profiles with missing closing angle brackets are invalid 1'); ok(build_profile_is_invalid('<missing angle brackets <here too>'), @@ -81,8 +84,11 @@ is_deeply([ parse_build_profiles('<nocheck !nodoc> <!stage1>') ], $formula, eval { parse_build_profiles('<invalid> + <characters>') }; ok($@, 'fail to parse build profiles with invalid characters'); +TODO: { + local $TODO = 'workaround due to incorrect API uses'; eval { parse_build_profiles('missing angle brackets') }; ok($@, 'fail to parse build profiles with missing opening/closing angles brackets'); +} eval { parse_build_profiles('<missing angle brackets <here too') }; ok($@, 'fail to parse build profiles with missing closing angles brackets 1'); -- Dpkg.Org's dpkg

