pause icon indicating copy to clipboard operation
pause copied to clipboard

Parsing makes cuckooed packages inherit first packages version

Open kentfredric opened this issue 9 years ago • 3 comments

As discovered by @neilbowers, this file: https://metacpan.org/source/NEILB/Text-Autoformat-1.69/lib/Text/Autoformat.pm

Entered the index such that the single file mapped to:

{ "Text::Autoformat" : 0.69,
  "Text::Autoformat::Hang" : 0.69,
  "Text::Autoformat::NullHang": 0.69 }

Whereas expected indexing was:

{ "Text::Autoformat" : 0.69,
  "Text::Autoformat::Hang" : null,
  "Text::Autoformat::NullHang": null }

He recently shipped his distribution with Module::Build, which automatically did meta.provides for him:

https://metacpan.org/diff/file?target=NEILB/Text-Autoformat-1.70/&source=NEILB/Text-Autoformat-1.69/

It mimicked the expected pattern above

{ "Text::Autoformat" : 0.70,
  "Text::Autoformat::Hang" : null,
  "Text::Autoformat::NullHang": null }

And caused a "Backwards versioning" issue.

It is believed that the original behaviour of indexing the latter packages under the same version as the former is an error.

kentfredric avatar May 04 '15 22:05 kentfredric

This feels like a recent regression to me -- surely if this behaviour had always been there we would have noticed it sooner.

karenetheridge avatar May 05 '15 18:05 karenetheridge

Maybe, but I'm not sure what change might have introduced this kind of thing recently. Anyway, easy to test and probably easy to fix! :)

rjbs avatar May 07 '15 14:05 rjbs

No. It's been there for quite a long time, at least since 2003 (I stopped tracking when I found the following example, but it should be older).

https://github.com/andk/pause/blob/2633f058b2f312d7336ae3948e088eb3edfc9112/cron/mldistwatch#L1403

If we do need to make PAUSE work like Module::Build, just replacing $version in the following line with "undef" (and reindex every non-simile packages) should do the trick, but I'm not so sure which should be fixed actually.

https://github.com/andk/pause/blob/master/lib/PAUSE/pmfile.pm#L312

charsbar avatar May 19 '15 05:05 charsbar