Skip Menu |

This queue is for tickets about the Module-ScanDeps CPAN distribution.

Report information
The Basics
Id: 73867
Status: rejected
Priority: 0/
Queue: Module-ScanDeps

People
Owner: Nobody in particular
Requestors: florent.angly [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 1.07



Subject: Wrong type reported?
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
Subject: Config.pm
# This is CPAN.pm's systemwide configuration file. This file provides # defaults for users, and the values can be changed in a per-user # configuration file. The user-config file is being looked for as # /root/.local/share/.cpan/CPAN/MyConfig.pm. $CPAN::Config = { 'applypatch' => q[], 'auto_commit' => q[0], 'build_cache' => q[100], 'build_dir' => q[/root/.cpan/build], 'build_dir_reuse' => q[0], 'build_requires_install_policy' => q[ask/yes], 'bzip2' => q[/bin/bzip2], 'cache_metadata' => q[1], 'check_sigs' => q[0], 'commandnumber_in_prompt' => q[1], 'connect_to_internet_ok' => q[1], 'cpan_home' => q[/root/.cpan], 'curl' => q[/usr/bin/curl], 'ftp' => q[/usr/bin/ftp], 'ftp_passive' => q[1], 'ftp_proxy' => q[], 'getcwd' => q[cwd], 'gpg' => q[/usr/bin/gpg], 'gzip' => q[/bin/gzip], 'halt_on_failure' => q[0], 'histfile' => q[/root/.cpan/histfile], 'histsize' => q[100], 'http_proxy' => q[], 'inactivity_timeout' => q[0], 'index_expire' => q[1], 'inhibit_startup_message' => q[0], 'keep_source_where' => q[/root/.cpan/sources], 'load_module_verbosity' => q[v], 'lynx' => q[], 'make' => q[/usr/bin/make], 'make_arg' => q[], 'make_install_arg' => q[], 'make_install_make_command' => q[/usr/bin/make], 'makepl_arg' => q[INSTALLDIRS=site], 'mbuild_arg' => q[], 'mbuild_install_arg' => q[], 'mbuild_install_build_command' => q[./Build], 'mbuildpl_arg' => q[--installdirs site], 'ncftp' => q[], 'ncftpget' => q[], 'no_proxy' => q[], 'pager' => q[/usr/bin/less], 'patch' => q[/usr/bin/patch], 'perl5lib_verbosity' => q[v], 'prefer_installer' => q[MB], 'prefs_dir' => q[/root/.cpan/prefs], 'prerequisites_policy' => q[ask], 'scan_cache' => q[atstart], 'shell' => q[/bin/bash], 'show_unparsable_versions' => q[0], 'show_upload_date' => q[0], 'show_zero_versions' => q[0], 'tar' => q[/bin/tar], 'tar_verbosity' => q[v], 'term_is_latin' => q[1], 'term_ornaments' => q[1], 'test_report' => q[0], 'trust_test_report_history' => q[0], 'unzip' => q[/usr/bin/unzip], 'urllist' => [], 'use_sqlite' => q[0], 'wget' => q[/usr/bin/wget], 'yaml_load_code' => q[0], 'yaml_module' => q[YAML], }; 1; __END__
File /usr/share/perl5/Error/Simple.pm is an interesting example: http://cpansearch.perl.org/src/SHLOMIF/Error-0.17016/lib/Error.pm It does not contain the 'package' directive. Since the file for the CPAN::Config module is in /etc/, it is easy to see that it is meant as a configuration file, but that is not a very portable way to identify this type of file.
On 2012-01-10 00:37:24, FANGLY wrote: Show quoted text
> does not contain any "package CPAN::Config;" line. It is more like > configuration file (see the attached file). Would it not be > more proper for it to be classified with a 'data' type > instead of 'module'?
No. It's loaded via "require" or "use". That's a module. Show quoted text
> File /usr/share/perl5/Error/Simple.pm is an interesting example: > http://cpansearch.perl.org/src/SHLOMIF/Error-0.17016/lib/Error.pm > > It does not contain the 'package' directive.
That's irrelevant. Show quoted text
> Since the file for the CPAN::Config module is in /etc/, it is easy to > see that it is meant as a configuration file, but that is not a very > portable way to identify this type of file.
Installing modules into /etc is specific to Debian? Anyway it doesn't imply that the file isn't a module. It means it may be modified by the administrator to taylor the system (and hence the packaging system should NOT simply overwrite it when updating the package it is in). Anyway, that doesn't affect its role wrt Perl. Closing this non-bug. Please use the PAR mailing list (par@perl.org) for such discussions. Cheers, Roderich