Subject: | _split_package_string does not parse bad package formats |
CPANPLUS::Internals::Utils::_split_package_string has a parsing problem
with some malformed packages. The following package are examples of
malformed package names
id/A/AU/AUSCHUTZ/IO-Stty-.01.tar.gz
id/A/AU/AUSCHUTZ/IO-Stty-.02.tar.gz
id/D/DK/DKYGER/Parse-Nessus-ENX-.01.tar.gz
id/D/DK/DKYGER/Parse-Nessus-NBE-.01.tar.gz
id/D/DU/DURIST/Drupal-Admin-.01.tar.gz
id/S/SA/SAXJAZMAN/database/Database-Schema-Config-.01.tar.gz
id/S/SA/SAXJAZMAN/database/Database-Schema-Config-.02.tar.gz
perl -MData::Dumper -MCPANPLUS::Backend -le 'my $cb =
CPANPLUS::Backend->new(); my $mod = $cb->module_tree("IO::Stty"); print
Dumper($mod); printf("PACKAGE(%s) VERSION(%s)\n",$mod->package_name,
$mod->package_version)'
$VAR1 = bless( {
'mtime' => '',
'version' => '.02',
'_id' => 1,
'author' => bless( {
'email' => 'tex@habit.com',
'_id' => 1,
'cpanid' => 'AUSCHUTZ',
'author' => 'Austin Schutz'
}, 'CPANPLUS::Module::Author' ),
'dslip' => 'Rdpfp',
'path' => 'authors/id/A/AU/AUSCHUTZ',
'description' => 'POSIX compliant stty interface',
'package' => 'IO-Stty-.02.tar.gz',
'comment' => undef,
'module' => 'IO::Stty'
}, 'CPANPLUS::Module' );
PACKAGE() VERSION()
The regex in CPANPLUS/Internals/Utils.pm needs to be updated
--- /usr/local/share/perl/5.8.8/CPANPLUS/Internals/Utils.pm
2009-03-29 18:34:27.000000000 -0400
+++ ../lib/CPANPLUS/Internals/Utils.pm 2009-03-29 18:33:46.000000000 -0400
@@ -495,7 +495,7 @@
)*
/xi;
- my $ver_re = qr/[a-z]*\d+[a-z]* # contains a digit and possibly
letters
+ my $ver_re = qr/[a-z.]*\d+[a-z]* # contains a digit and
possibly letters
(?:
[-._] # followed by a delimiter
[a-z\d]+ # and more digits and or letters