fix perl prereq in Makefile.PL
[p5sagit/local-lib.git] / Makefile.PL
index 55fed74..8b045aa 100644 (file)
@@ -209,7 +209,7 @@ my %extra_info = (
     license => [ 'http://dev.perl.org/licenses/' ],
   },
   prereqs => {
-    runtime   => { requires => { perl => '5.8.1' } },
+    runtime   => { requires => { perl => '5.6.0' } },
   },
 );
 
@@ -259,7 +259,7 @@ else {
                 my $value = $CPAN::Config->{$setting} or next;
                 if ($setting =~ /^make/
                   ? $value =~ /(?:PREFIX|INSTALL_BASE)/
-                  : /(?:--prefix|--install_base)/
+                  : $value =~ /(?:--prefix|--install_base)/
                 ) {
                     die <<"DEATH";
 WHOA THERE! It looks like you've got $CPAN::Config->{$setting} set in
@@ -283,12 +283,13 @@ chdir($cwd);
 @{$extra_info{prereqs}{runtime}{requires}}{keys %RUN_DEPS} = values %RUN_DEPS;
 
 # have to do this since old EUMM dev releases miss the eval $VERSION line
-my $mymeta_works = do { no warnings; $ExtUtils::MakeMaker::VERSION >= 6.57_07 };
-my $mymeta = do { no warnings; $ExtUtils::MakeMaker::VERSION >= 6.57_02 };
+my $eumm_version = eval $ExtUtils::MakeMaker::VERSION;
+my $mymeta_works = $eumm_version >= 6.57_07;
+my $mymeta = $eumm_version >= 6.57_02;
 
-my $has_test_requires = do { no warnings; $ExtUtils::MakeMaker::VERSION >= 6.63_03 };
+my $has_test_requires = $eumm_version >= 6.63_03;
 
-my $has_meta_v2 = do { no warnings; $ExtUtils::MakeMaker::VERSION >= 6.57_10 };
+my $has_meta_v2 = $eumm_version >= 6.57_10;
 if (! $has_meta_v2) {
   %extra_info = ();
 }
@@ -308,8 +309,8 @@ WriteMakefile(
   PREREQ_PM => {
     %RUN_DEPS,
   },
-  keys %BUILD_DEPS ? ( BUILD_REQUIRES => \%BUILD_DEPS ) : (),
-  keys %TEST_DEPS ? ( TEST_REQUIRES => \%TEST_DEPS ) : (),
+  BUILD_REQUIRES => \%BUILD_DEPS,
+  TEST_REQUIRES => \%TEST_DEPS,
   META_ADD => \%extra_info,
   META_MERGE => {
     no_index => {