Source: devscripts
Source-Version: 2.18.3
Severity: normal

Hi!

Due to #895004, the semantics of Dpkg::Version in bool context will get
unbroken back to their original behavior. This was at the time and
it is now again an API break, but any other solution was deemed worse.
To avoid silent breakage the module now emits a perl warning so that
users can check and fix the broken code or quiesce the warning.

After skimming over the source, I notice at least this obvious case
that seems correct to me with the fixed semantics (and broken before):

  scripts/debchange.pl:
  1600:    fatal "No version number in debian/changelog!"
  1601:        unless $v;

Analyzing the rest, or running the code could reveal some other bool
context usage, which would emit a warning.

If the new behavior is fine (bool evaluation will be an alias to
is_valid()), then please add the following to those files until
dpkg 1.20.x:

  # Temporarily disable the warning until dpkg 1.20.x, as our usage is correct.
  no if $Dpkg::Version::VERSION ge '1.02',
     warnings => qw(Dpkg::Version::semantic_change::overload::bool);

otherwise, please change those to match the previous behavior of
as_string() if is_valid().

Thanks,
Guillem

Reply via email to