Skip to content
Browse files

more stuff and nonsense

  • Loading branch information...
1 parent fab6ceb commit c0bfb05447c38153a83b5758ff8c30698e906fdc @bingos committed Oct 23, 2009
Showing with 36 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +35 −0 cpdeprecated.pl
View
1 .gitignore
@@ -0,0 +1 @@
+.cpanplus
View
35 cpdeprecated.pl
@@ -0,0 +1,35 @@
+use 5.11.1;
+use strict;
+use warnings;
+use Config;
+use Module::CoreList;
+use Module::Load::Conditional qw[check_install];
+use CPANPLUS::Backend;
+use CPANPLUS::Error;
+use CPANPLUS::Internals::Constants;
+
+my $mod = shift || die "usage: cpdeprecated.pl <module>\n";
+my $version = shift || '0';
+
+my $cb = CPANPLUS::Backend->new();
+my $modobj = $cb->module_tree($mod);
+
+unless( $modobj ) {
+ # Check if it is a core module
+ my $sub = CPANPLUS::Module->can(
+ 'module_is_supplied_with_perl_core' );
+ my $core = $sub->( $mod );
+ unless ( $core ) {
+ error( loc( "No such module '%1' found on CPAN", $mod ) );
+ exit;
+ }
+ if ( $cb->_vcmp( $version, $core ) > 0 ) {
+ error(loc( "Version of core module '%1' ('%2') is too low for ".
+ "'%3' (needs '%4') -- carrying on but this may be a problem",
+ $mod, $core,
+ 'Foo', $version ));
+ }
+ exit;
+}
+
+print "Moo\n" if $modobj->is_uptodate( version => $version );

0 comments on commit c0bfb05

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