diff options
-rw-r--r-- | debian/changelog | 8 | ||||
-rw-r--r-- | lib/Debian/Debhelper/Dh_Lib.pm | 12 |
2 files changed, 18 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog index d7bbe0d9..2db581eb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,14 @@ debhelper (12.1) UNRELEASED; urgency=medium * dh_strip: Print a warning when an ELF binary does not have a build-id (or when dh_strip cannot find it). + [ Niels Thykier ] + * Dh_Lib.pm: Strip leading and trailing whitespace from lines in + regular debhelper config files. Whitespace-only lines from + executable config files are now explicitly detected and triggers + a human readable error message early rather than warnings/errors + about uninitialized variables. Thanks to Ben Finney for the + suggestion and the initial patch. (Closes: #919853) + -- Niels Thykier <niels@thykier.net> Fri, 04 Jan 2019 18:27:58 +0100 debhelper (12) unstable; urgency=medium diff --git a/lib/Debian/Debhelper/Dh_Lib.pm b/lib/Debian/Debhelper/Dh_Lib.pm index 482e758e..f78f3248 100644 --- a/lib/Debian/Debhelper/Dh_Lib.pm +++ b/lib/Debian/Debhelper/Dh_Lib.pm @@ -1387,9 +1387,17 @@ sub filedoublearray { my @ret; while (<DH_FARRAY_IN>) { chomp; - if (not $x) { - next if /^#/ || /^$/; + if ($x) { + if (m/^\s++$/) { + error("Executable config file $file produced a non-empty whitespace-only line"); + } + } else { + s/^\s++//; + next if /^#/; + s/\s++$//; } + # We always ignore/permit empty lines + next if $_ eq ''; my @line; if (defined($globdir) && ! $x) { |