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=1267a2135cba8f5d4950f2456160027234694983 commit 1267a2135cba8f5d4950f2456160027234694983 Author: Guillem Jover <[email protected]> AuthorDate: Wed Sep 14 04:56:47 2022 +0200 Dpkg::Deps: Merge dependency string into a single line when parsing When we parse dependency information we need to remap it into a single-line so that the parser can do its job correctly. Closes: #1019565 --- scripts/Dpkg/Deps.pm | 2 ++ scripts/t/Dpkg_Deps.t | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/Dpkg/Deps.pm b/scripts/Dpkg/Deps.pm index 4e2b391fa..3e66109c1 100644 --- a/scripts/Dpkg/Deps.pm +++ b/scripts/Dpkg/Deps.pm @@ -296,6 +296,8 @@ sub deps_parse { tests_dep => $options{tests_dep}, ); + # Merge in a single-line + $dep_line =~ s/\s*[\r\n]\s*/ /g; # Strip trailing/leading spaces $dep_line =~ s/^\s+//; $dep_line =~ s/\s+$//; diff --git a/scripts/t/Dpkg_Deps.t b/scripts/t/Dpkg_Deps.t index 3bad94d6b..8694adffa 100644 --- a/scripts/t/Dpkg_Deps.t +++ b/scripts/t/Dpkg_Deps.t @@ -53,10 +53,13 @@ test_dep_parse_option(build_arch => 'linux-any'); test_dep_parse_option(build_arch => 'unknown-arch'); my $field_multiline = ' , , libgtk2.0-common (= 2.10.13-1) , libatk1.0-0 (>= -1.13.2), libc6 (>= 2.5-5), libcairo2 (>= 1.4.0), libcupsys2 (>= 1.2.7), +1.13.2), libc6 (>= 2.5-5), libcairo2 (>= 1.4.0), libcupsys2 (>= 1.2.7) <profile.a> +<profile.b +profile.c> +<profile.d>, libfontconfig1 (>= 2.4.0), libglib2.0-0 ( >= 2.12.9), libgnutls13 (>= 1.6.3-0), libjpeg62, python (<< 2.5) , , '; -my $field_multiline_sorted = 'libatk1.0-0 (>= 1.13.2), libc6 (>= 2.5-5), libcairo2 (>= 1.4.0), libcupsys2 (>= 1.2.7), libfontconfig1 (>= 2.4.0), libglib2.0-0 (>= 2.12.9), libgnutls13 (>= 1.6.3-0), libgtk2.0-common (= 2.10.13-1), libjpeg62, python (<< 2.5)'; +my $field_multiline_sorted = 'libatk1.0-0 (>= 1.13.2), libc6 (>= 2.5-5), libcairo2 (>= 1.4.0), libcupsys2 (>= 1.2.7) <profile.a> <profile.b profile.c> <profile.d>, libfontconfig1 (>= 2.4.0), libglib2.0-0 (>= 2.12.9), libgnutls13 (>= 1.6.3-0), libgtk2.0-common (= 2.10.13-1), libjpeg62, python (<< 2.5)'; my $dep_multiline = deps_parse($field_multiline); $dep_multiline->sort(); -- Dpkg.Org's dpkg

