This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make Module::CoreList install into 'site' >= 5.012
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Thu, 26 Jul 2012 14:58:02 +0000 (15:58 +0100)
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Thu, 26 Jul 2012 15:14:20 +0000 (16:14 +0100)
Also if versiononly is set make sure that corelist is installed
with the appropriate versioned suffix.

dist/Module-CoreList/Makefile.PL

index fd55b68..3fd5f61 100644 (file)
@@ -1,6 +1,7 @@
 use ExtUtils::MakeMaker;
 
-push @extra, 'INSTALLDIRS' => 'perl' if $] >= 5.008009;
+push @extra, 'INSTALLDIRS' => 'perl' if $] >= 5.008009 and $] < 5.012;
+
 
 WriteMakefile
 (
@@ -10,9 +11,24 @@ WriteMakefile
     'PREREQ_PM' => {
        'Test::More' => '0',
     },
-    'EXE_FILES' => [ 'corelist' ],
+    'EXE_FILES' => [ _scripts() ],
     'PL_FILES' => {},
     LICENSE => 'perl',
     @extra,
 )
 ;
+
+sub _scripts {
+ my $scripts = 'corelist';
+ if ( $] >= 5.008009 and !$ENV{PERL_CORE} ) {
+   require Config;
+   my $version = sprintf("%vd",$^V);
+   if ( $Config::Config{versiononly} and
+      $Config::Config{startperl} =~ /\Q$version\E$/ ) {
+      require File::Copy;
+      File::Copy::copy( 'corelist', "corelist$version" );
+      $scripts = "corelist$version";
+    }
+ }
+ return $scripts;
+}