diff options
author | Guillem Jover <guillem@debian.org> | 2019-11-16 00:37:17 +0100 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2019-11-26 02:42:45 +0100 |
commit | 69b98260c76342a72f3c819961a33b9a14e899ab (patch) | |
tree | 7c4ef933575ab9065bba2dd17804fec982337574 | |
parent | 2c08a8a2a2503398c7d17b4ecb7f364ea4eb3aed (diff) | |
download | dpkg-69b98260c76342a72f3c819961a33b9a14e899ab.tar.gz |
Dpkg::Version: Remove deprecation warning from semantic change in bool overload
-rw-r--r-- | debian/changelog | 2 | ||||
-rw-r--r-- | scripts/Dpkg/Version.pm | 13 | ||||
-rw-r--r-- | scripts/t/Dpkg_Version.t | 6 |
3 files changed, 8 insertions, 13 deletions
diff --git a/debian/changelog b/debian/changelog index 93c9c2f08..a87e747ca 100644 --- a/debian/changelog +++ b/debian/changelog @@ -65,6 +65,8 @@ dpkg (1.20.0) UNRELEASED; urgency=medium $diff_ignore_default_regexp. - Dpkg::Substvars: Remove obsolete no_warn() method. - Dpkg::Index: Change default value for unique_tuple_key to 1. + - Dpkg::Version: Remove deprecation warning from semantic change in + bool overload. * Documentation: - man: Fix uncommon wording constructs. - man: Use a minus sign for a literal string. diff --git a/scripts/Dpkg/Version.pm b/scripts/Dpkg/Version.pm index 2900e5790..51d46c543 100644 --- a/scripts/Dpkg/Version.pm +++ b/scripts/Dpkg/Version.pm @@ -22,7 +22,7 @@ use strict; use warnings; use warnings::register qw(semantic_change::overload::bool); -our $VERSION = '1.02'; +our $VERSION = '1.03'; our @EXPORT = qw( version_compare version_compare_relation @@ -56,12 +56,7 @@ use overload '<=>' => \&_comparison, 'cmp' => \&_comparison, '""' => sub { return $_[0]->as_string(); }, - 'bool' => sub { - warnings::warnif('Dpkg::Version::semantic_change::overload::bool', - 'Dpkg::Version bool overload behavior has changed ' . - 'back to be an is_valid() alias'); - return $_[0]->is_valid(); - }, + 'bool' => sub { return $_[0]->is_valid(); }, 'fallback' => 1; =encoding utf8 @@ -473,6 +468,10 @@ sub version_check($) { =head1 CHANGES +=head2 Version 1.03 (dpkg 1.20.0) + +Remove deprecation warning from semantic change in 1.02. + =head2 Version 1.02 (dpkg 1.19.1) Semantic change: bool evaluation semantics restored to their original behavior. diff --git a/scripts/t/Dpkg_Version.t b/scripts/t/Dpkg_Version.t index 34ab1772f..69f0fecf0 100644 --- a/scripts/t/Dpkg_Version.t +++ b/scripts/t/Dpkg_Version.t @@ -85,12 +85,6 @@ my $truth = { }, }; -# XXX: Some of the tests check the bool overload, which currently emits -# the semantic_change warning. Disable it until we stop emitting the -# warning in dpkg 1.20.x. -## no critic (TestingAndDebugging::ProhibitNoWarnings) -no warnings(qw(Dpkg::Version::semantic_change::overload::bool)); - # Handling of empty/invalid versions my $empty = Dpkg::Version->new(''); ok($empty eq '', "Dpkg::Version->new('') eq ''"); |