Skip Menu |

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

Report information
The Basics
Id: 21160
Status: resolved
Priority: 0/
Queue: Module-CPANTS-Analyse

People
Owner: Nobody in particular
Requestors: smueller [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.62
Fixed in: (no value)



Subject: Update for the broken_installer metric
Hi, attached are a diff from BrokenInstaller.pm of the 0.62 release on CPAN to a patched version which checks whether the auto_install feature is used in Makefile.PL with Module::Install prior to 0.64. For reference, see http://use.perl.org/~Alias/journal/30731?from=rss I also attached the modified file for completeness. Steffen
Subject: diff.txt
--- BrokenInstaller.pm 2006-08-24 12:23:18.000000000 +0200 +++ patched_BrokenInstaller.pm 2006-08-24 12:22:55.000000000 +0200 @@ -12,8 +12,10 @@ my $me = shift; my $distdir = $me->distdir; - my $mi = catfile(catdir($distdir, 'inc', 'Module'), 'Install.pm'); + # inc/Module/Install.pm file + my $mi = catfile($distdir, 'inc', 'Module', 'Install.pm'); + # Must be okay if not using Module::Install if (not -f $mi) { $me->d->{broken_module_install} = 0; return; @@ -23,6 +25,7 @@ or die "Could not open file '$mi' for checking the bad_installer metric: $!"; my $buf; read $ih, $buf, 100000 or die $!; + close $ih; if ($buf =~ /VERSION\s*=\s*("|'|)(\d+|\d*\.\d+(?:_\d+)?)\1/m) { my $version = $2; my $non_devel = $version; @@ -30,6 +33,22 @@ if ($non_devel < 0.61) { $me->d->{broken_module_install} = $version; } + elsif ($non_devel < 0.64) { + $me->d->{broken_module_install} = 0; + + my $makefilepl = catfile($distdir, 'Makefile.PL'); + return if not -f $makefilepl; + + open my $ih, '<', $makefilepl + or die "Could not open file '$makefilepl' for checking the bad_installer metric: $!"; + local $/ = undef; + my $mftext = <$ih>; + close $ih; + + return if not defined $mftext or $mftext !~ /auto_install/; + + $me->d->{broken_module_install} = $version; + } else { $me->d->{broken_module_install} = 0; } @@ -38,6 +57,7 @@ # Unknown version (parsing $VERSION failed) $me->d->{broken_module_install} = 1; } + return; } @@ -47,7 +67,7 @@ return [ { name=>'has_working_buildtool', - error=>q{This package uses an obsolete version of Module::Install. Versions of Module::Install prior to 0.61 might not work on some systems at all.}, + error=>q{This package uses an obsolete version of Module::Install. Versions of Module::Install prior to 0.61 might not work on some systems at all. Additionally if your Makefile.PL uses the 'auto_install()' feature, you need at least version 0.64.}, remedy=>q{Upgrade the bundled version of Module::Install to at least 0.61, but preferably to the most current release. Alternatively, you can switch to another build system / installer that does not suffer from this problem. (ExtUtils::MakeMaker, Module::Build both of which have their own set of problems.)}, code=>sub { shift->{broken_module_install} ? 0 : 1 }, @@ -86,6 +106,9 @@ C<MCK::BrokenInstaller> checks whether the distribution uses Module::Install and if so whether it uses a reasonably current version of it (0.61 or later). +It also checks whether the F<Makefile.PL> uses the C<auto_install> feature. +If so, C<Module::Install> should be at least version 0.64. + =head3 kwalitee_indicators Returns the Kwalitee Indicators datastructure. @@ -102,7 +125,7 @@ =head1 AUTHOR -Steffen Mueller, <smueller@cpan.org>, http://steffen-mueller.net +Steffen Müller, <smueller@cpan.org>, http://steffen-mueller.net Thomas Klausner, <domm@cpan.org>, http://domm.zsi.at
Subject: patched_BrokenInstaller.pm
package Module::CPANTS::Kwalitee::BrokenInstaller; use warnings; use strict; use File::Find; use File::Spec::Functions qw(catdir catfile abs2rel); use File::stat; sub order { 100 } sub analyse { my $class = shift; my $me = shift; my $distdir = $me->distdir; # inc/Module/Install.pm file my $mi = catfile($distdir, 'inc', 'Module', 'Install.pm'); # Must be okay if not using Module::Install if (not -f $mi) { $me->d->{broken_module_install} = 0; return; } open my $ih, '<', $mi or die "Could not open file '$mi' for checking the bad_installer metric: $!"; my $buf; read $ih, $buf, 100000 or die $!; close $ih; if ($buf =~ /VERSION\s*=\s*("|'|)(\d+|\d*\.\d+(?:_\d+)?)\1/m) { my $version = $2; my $non_devel = $version; $non_devel =~ s/_\d+$//; if ($non_devel < 0.61) { $me->d->{broken_module_install} = $version; } elsif ($non_devel < 0.64) { $me->d->{broken_module_install} = 0; my $makefilepl = catfile($distdir, 'Makefile.PL'); return if not -f $makefilepl; open my $ih, '<', $makefilepl or die "Could not open file '$makefilepl' for checking the bad_installer metric: $!"; local $/ = undef; my $mftext = <$ih>; close $ih; return if not defined $mftext or $mftext !~ /auto_install/; $me->d->{broken_module_install} = $version; } else { $me->d->{broken_module_install} = 0; } } else { # Unknown version (parsing $VERSION failed) $me->d->{broken_module_install} = 1; } return; } sub kwalitee_indicators { return [ { name=>'has_working_buildtool', error=>q{This package uses an obsolete version of Module::Install. Versions of Module::Install prior to 0.61 might not work on some systems at all. Additionally if your Makefile.PL uses the 'auto_install()' feature, you need at least version 0.64.}, remedy=>q{Upgrade the bundled version of Module::Install to at least 0.61, but preferably to the most current release. Alternatively, you can switch to another build system / installer that does not suffer from this problem. (ExtUtils::MakeMaker, Module::Build both of which have their own set of problems.)}, code=>sub { shift->{broken_module_install} ? 0 : 1 }, }, ]; } 1 __END__ =pod =head1 NAME Module::CPANTS::Kwalitee::BrokenInstaller - Check for broken Module::Install =head1 SYNOPSIS Find out whether the distribution uses an outdaten version of Module::Install. =head1 DESCRIPTION =head2 Methods =head3 order Defines the order in which Kwalitee tests should be run. Returns C<100>, as data generated by this should not be used by any other tests. =head3 analyse C<MCK::BrokenInstaller> checks whether the distribution uses Module::Install and if so whether it uses a reasonably current version of it (0.61 or later). It also checks whether the F<Makefile.PL> uses the C<auto_install> feature. If so, C<Module::Install> should be at least version 0.64. =head3 kwalitee_indicators Returns the Kwalitee Indicators datastructure. =over =item * uses_broken_installer =back =head1 SEE ALSO L<Module::CPANTS::Analyse> =head1 AUTHOR Steffen Müller, <smueller@cpan.org>, http://steffen-mueller.net Thomas Klausner, <domm@cpan.org>, http://domm.zsi.at =head1 COPYRIGHT You may use and distribute this module according to the same terms that Perl is distributed under. =cut
resolved in 0.65, thanks for the patch!