This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch master in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=6227aa720d9ce637e676bdc0096fb8316576348f commit 6227aa720d9ce637e676bdc0096fb8316576348f Author: Guillem Jover <[email protected]> AuthorDate: Mon Jul 23 12:13:31 2018 +0200 Dpkg::Substvars: Reword used/unused warnings to clarify their meaning Clarify the unknown and unused substitution variable warnings, to try to make them more clear as to what each implies. Closes: #904258 --- debian/changelog | 2 ++ scripts/Dpkg/Substvars.pm | 6 ++++-- scripts/t/Dpkg_Substvars.t | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index fd30747c2..19fa87c6a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -134,6 +134,8 @@ dpkg (1.19.1) UNRELEASED; urgency=medium - Dpkg::Deps: Split subpackages into their own separate modules. - Dpkg::Source: Do not change patch permissions if not necessary. Closes: #898010 + - Dpkg::Substvars: Reword used/unused warnings to clarify their meaning. + Closes: #904258 * Documentation: - Update gettext minimal version in README. - Add a missing dot on the dpkg-buildflags(1) «lfs» feature paragraph. diff --git a/scripts/Dpkg/Substvars.pm b/scripts/Dpkg/Substvars.pm index 1e9f90173..637072846 100644 --- a/scripts/Dpkg/Substvars.pm +++ b/scripts/Dpkg/Substvars.pm @@ -342,7 +342,8 @@ sub substvars { g_('obsolete substitution variable ${%s}'), $vn); } } else { - warning($opts{msg_prefix} . g_('unknown substitution variable ${%s}'), + warning($opts{msg_prefix} . + g_('substitution variable ${%s} used, but is not defined'), $vn) unless $opts{no_warn}; $v = $lhs . $rhs; } @@ -366,7 +367,8 @@ sub warn_about_unused { # that they are not required in the current situation # (example: debhelper's misc:Depends in many cases) next if $self->{vars}{$vn} eq ''; - warning($opts{msg_prefix} . g_('unused substitution variable ${%s}'), + warning($opts{msg_prefix} . + g_('substitution variable ${%s} unused, but is defined'), $vn); } } diff --git a/scripts/t/Dpkg_Substvars.t b/scripts/t/Dpkg_Substvars.t index bb8e14039..6c7be24f2 100644 --- a/scripts/t/Dpkg_Substvars.t +++ b/scripts/t/Dpkg_Substvars.t @@ -97,7 +97,7 @@ is($s->substvars('This is a string with unknown variable ${blubb}'), 'substvars missing'); delete $SIG{__WARN__}; is($output, - 'Dpkg_Substvars.t: warning: test unknown substitution variable ${blubb}' . "\n", + 'Dpkg_Substvars.t: warning: test substitution variable ${blubb} used, but is not defined' . "\n", 'missing variables warning'); # Recursive replace @@ -117,7 +117,7 @@ $SIG{__WARN__} = sub { $output .= $_[0] }; $s->warn_about_unused(); delete $SIG{__WARN__}; is($output, - 'Dpkg_Substvars.t: warning: test unused substitution variable ${var2}' . "\n", + 'Dpkg_Substvars.t: warning: test substitution variable ${var2} unused, but is defined' . "\n", 'unused variables warnings'); # Disable warnings for a certain variable -- Dpkg.Org's dpkg

