Author: dagolden
Date: Sun Sep 13 05:20:44 2009
New Revision: 13326

Modified:
   Module-Build/branches/inc-bundling/lib/Module/Build/Base.pm

Log:
automatically add inc::latest loaded to configure_requires

Modified: Module-Build/branches/inc-bundling/lib/Module/Build/Base.pm
==============================================================================
--- Module-Build/branches/inc-bundling/lib/Module/Build/Base.pm (original)
+++ Module-Build/branches/inc-bundling/lib/Module/Build/Base.pm Sun Sep 13 
05:20:44 2009
@@ -52,7 +52,7 @@
     }
   }
 
-  $self->check_bundling;
+  $self->set_bundle_inc;
 
   $self->dist_name;
   $self->dist_version;
@@ -1175,7 +1175,7 @@
     '^Devel::AssertOS'    => 'Devel::CheckOS',
   );
 
-  sub check_bundling {
+  sub set_bundle_inc {
     my $self = shift;
     my $bundle_inc = $self->{properties}{bundle_inc};
     # We're in author mode if inc::latest is loaded, but not from cwd
@@ -1278,6 +1278,17 @@
     $self->_add_prereq('configure_requires', 'Module::Build', $ver);
   }
 
+  # if we're in author mode, add inc::latest modules to 
+  # configure_requires if not already set.  If we're not in author mode
+  # then configure_requires will have been satisfied, or we'll just
+  # live with what we've bundled
+  if ( $INC{'inc/latest.pm'} && ! -e 'inc/latest.pm' ) {
+    for my $mod ( inc::latest->loaded_modules ) {
+      next if exists $p->{configure_requires}{$mod};
+      $self->_add_prereq('configure_requires', $mod, $mod->VERSION);
+    }
+  }
+
   # If needs_compiler is not explictly set, automatically set it
   # If set, we need ExtUtils::CBuilder (and a compiler)
   my $xs_files = $self->find_xs_files;

Reply via email to