Bug#841737: libmodule-corelist-perl: is_core with version returns false

Salvatore Bonaccorso carnil at debian.org
Sun Oct 23 15:30:58 UTC 2016


Hi

Just from a quick look yet, so no trhoughfull analysis, we land in the
following part of the code for is_core:

13288     # If a minimum version of the module was specified:
13289     # Step through all perl releases ($prn)
13290     # so we can find what version of the module
13291     # was included in the specified version of perl.
13292     # On the way if we pass the required module version, we can
13293     # short-circuit and return true
13294     if (defined($module_version)) {
13295         # The Perl releases aren't a linear sequence, but a tree. We need to build the path
13296         # of releases from 5 to the specified release, and follow the module's version(s)
13297         # along that path.
13298         my @releases = ($perl_version);
13299         my $rel = $perl_version;
13300         while (defined($rel)) {
13301             # XXX: This line is a sign of failure. -- rjbs, 2015-04-15
13302             my $this_delta = $delta{$rel} || $delta{ sprintf '%0.6f', $rel };
13303             $rel = $this_delta->{delta_from};
13304             unshift(@releases, $rel) if defined($rel);
13305         }
13306         RELEASE:
13307         foreach my $prn (@releases) {
13308             next RELEASE if $prn < $first_release;
13309             last RELEASE if $prn > $perl_version;
13310             next unless defined(my $next_module_version
13311                                    = $delta{$prn}->{changed}->{$module});
13312             return 1 if version->parse($next_module_version) >= version->parse($module_version);
13313         }
13314         return 0;
13315     }
13316 
13317     return 1 if !defined($final_release);
13318 
13319     return $perl_version <= $final_release;
13320 }


Since not specified, @releases will be ('5.024001'). But there is not
defintiion for the 5.024001 release in lib/Module/Corelist.pm, so we
fall trough the RELEASE loop, and return 0.

$ perl -MModule::CoreList -E 'say Module::CoreList->is_core("Exporter", "5.60", "5.024001");'
0
$ perl -MModule::CoreList -E 'say Module::CoreList->is_core("Exporter", "5.60", "5.024000");'
1

And indeed if I add a pseudo-5.024001 into the lib/Module/Corelist.pm
with some virtual changes, it would work again as expected. So I
wonder were exactly we should pin-point the bug, because should
libmodule-corelist-perl as well return sensible values for is_core if
the system running $[ perl version is not yet known to the
Module::Corelist hashes?

Regards,
Salvatore



More information about the pkg-perl-maintainers mailing list