Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #13 from ptf/master

Add option to exclude core modules
  • Loading branch information...
commit 0f66368cf98b7ff3acb16cfceb56c9fe4f64a255 2 parents faa5195 + 57dfe01
@tokuhirom authored
Showing with 9 additions and 0 deletions.
  1. +1 −0  Makefile.PL
  2. +8 −0 bin/cpan-outdated
View
1  Makefile.PL
@@ -10,6 +10,7 @@ WriteMakefile(
'local::lib' => 1.006008,
'ExtUtils::MakeMaker' => 6.56,
'CPAN::DistnameInfo' => 0.10,
+ 'Module::CoreList' => 0,
'Module::Metadata' => 1.000007,
},
EXE_FILES => ['bin/cpan-outdated'],
View
8 bin/cpan-outdated
@@ -10,6 +10,7 @@ use version;
use LWP::Simple ();
use IO::Zlib;
use CPAN::DistnameInfo;
+use Module::CoreList ();
use Module::Metadata;
use constant WIN32 => $^O eq 'MSWin32';
@@ -34,12 +35,16 @@ Getopt::Long::GetOptions(
. "You can use 'cpan-listchanges `cpan-outdated -p`' instead.\n"
. "cpanm cpan-listchanges # install from CPAN\n"
},
+ 'exclude-core' => \my $exclude_core,
) or pod2usage();
pod2usage() if $help;
$mirror =~ s:/$::;
my $index_url = "${mirror}/modules/02packages.details.txt.gz";
+my $perl_version = sprintf '%d.%03d%03d', (map {ord} split('', $^V));
+my $core_modules = $Module::CoreList::version{$perl_version};
+
unless ($ENV{HARNESS_ACTIVE}) {
&main;
exit;
@@ -67,6 +72,9 @@ sub main {
# $Mail::SpamAssassin::Conf::VERSION is 'bogus'
# https://rt.cpan.org/Public/Bug/Display.html?id=73465
next unless $version =~ /[0-9]/;
+
+ # if excluding core modules
+ next if $exclude_core && exists $core_modules->{$pkg};
next if $dist =~ m{/perl-[0-9._]+\.tar\.(gz|bz2)$};
(my $file = $pkg) =~ s!::!/!g;

2 comments on commit 0f66368

@sharl

doesn't work.

$ perl -le 'print $^V'
v5.14.2
$ perl -MModule::CoreList -le 'print $Module::CoreList::VERSION'
2.49_02
$ perl -e 'printf "%d.%03d%03d \n", (map {ord} split("", $^V))'
118.053046

$ diff -u0 /usr/bin/cpan-outdated .
--- /usr/bin/cpan-outdated 2012-10-10 13:11:23.000000000 +0900
+++ ./cpan-outdated 2012-10-22 17:51:12.941523237 +0900
@@ -48,2 +48 @@
-my $perl_version = sprintf '%d.%03d%03d', (map {ord} split('', $^V));
-my $core_modules = $Module::CoreList::version{$perl_version};
+my $core_modules = $Module::CoreList::version{$]};

@tokuhirom
Owner

Note, this issue was fixed by 542e8c2
It's released with version 0.24, thanks.

Please sign in to comment.
Something went wrong with that request. Please try again.