Perl-Toolchain-Gang/Module-Metadata

Module::Metadata can't parse MLEHMANN/common-sense

Opened this issue · 5 comments

xenu commented

Module::Metadata can't handle MLEHMANN/common-sense. It's a very unusual distribution, looks like its author tried really hard to abuse PAUSE indexer as much as possible.

There are following problems:

  • ->package_versions_from_directory ignores .PL files (package and $VERSION are declared in sense.pm.PL).
  • stuff in __DATA__ is ignored (that's where package is declared in that distribution).
  • As opposed to Module::Metadata, PAUSE indexer doesn't really care in which package $VERSION was declared. With some exceptions, the first $VERSION definition is used with all packages in the parsed file ($VERSION is declared in main, not in common::sense).

If the shipped distribution deliberately obfuscates the code before installation, then we can't do much -- Module::Metadata will properly parse the installed code however.

haarg commented

It isn't obfuscation. It's generating a module because it has platform specific data in it. PAUSE has intentional support for extracting version information from a .PL file that is used to generate a module.

Leont commented

I'm not sure in what context this is a problem…

@Leont Dist::Metadata uses Module::Metadata to index dists, which means that both metacpan and my App::opan end up with confused results indexing dists. We should probably do something about this, whether it's adding an extra API designed for indexing source rather than an installed tree or just adding support for it to the existing API