Mon Jan 09 23:59:19 2012: Request 73867 was acted upon.
Transaction: Ticket created by FANGLY
       Queue: Module-ScanDeps
     Subject: Wrong type reported?
   Broken in: (no value)
    Severity: (no value)
       Owner: Nobody
  Requestors: florent.an...@gmail.com
      Status: new
 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=73867 >


Hi,

I am wondering exactly what the types 'module', 'autoload', 'data' and
'shared' mean. The documentation could need a brief explanation of this.

On my system, when I run:
   perl -e 'use Module::ScanDeps; my $deps =
Module::ScanDeps::scan_deps( files =>
["/usr/share/perl5/LWP/Protocol/cpan.pm"], recurse => 0 ); use
Data::Dumper; print Dumper($deps);'

This is part of what is returned:
   'CPAN/Config.pm' => {
                      'used_by' => [
                                     'LWP/Protocol/cpan.pm'
                                   ],
                      'file' => '/etc/perl/CPAN/Config.pm',
                      'type' => 'module',
                      'key' => 'CPAN/Config.pm'
                    },

This is problematic because Module::Install::Bundle relies on
Module::ScanDeps and tries to find a distribution on CPAN that contains
the module CPAN::Config. There is no such distribution and in fact, I am
not sure that we can call '/etc/perl/CPAN/Config.pm' a module because it
does not contain any "package CPAN::Config;" line. It is more like a
configuration file (see the attached file). Would it not be more proper
for it to be classified with a 'data' type instead of 'module'?

Maybe line 1374 of ScanDeps.pm, within the _gettype function should be
amended:
   return 'module'   if $name =~ /\.p[mh]$/i;
Instead of simply recognizing a 'module' based on its extension, should
it not look inside the file to verify that there is a line like 'package
CPAN::Config;'?

Thanks and regards,

Florent

Attachment: Config.pm
Description: Perl program

Reply via email to