[Bioperl-l] a thought on Bio::Root::Build

Mark A. Jensen maj at fortinbras.us
Sun Jan 25 21:44:42 EST 2009


Sendu--
Following is a little more thoughtful. Summary is

+ # CPAN-install prereqs in the install set selected by the
+ # user when ./Build.PL or ./Build was run...unless the
+ # user's MyConfig.pm overrides.
+ # However, if Module::CoreList is available, install
+ # core module updates to the core install set (if the
+ # module was part of the core when the local Perl was
+ # installed...)

MAJ

Index: Build.pm
===================================================================
--- Build.pm (revision 15441)
+++ Build.pm (working copy)
@@ -101,12 +101,16 @@

 use strict;
 use warnings;
+use CPAN; # use here to get %{$CPAN::Config} with user defaults

 our $VERSION = '1.007000';
 our @extra_types = qw(options excludes_os feature_requires test); # test must 
always be last in the list!
 our $checking_types = "requires|conflicts|".join("|", @extra_types);
+our $myconfig_mbuildpl_arg = $$CPAN::Config{mbuildpl_arg};
+our $myconfig_makepl_arg = $$CPAN::Config{makepl_arg};


+
 # our modules are in Bio, not lib
 sub find_pm_files {
     my $self = shift;
@@ -441,11 +445,37 @@
         # being we continue even if installation fails, and that this works
         # even when not using CPAN to install.
         require Cwd;
-        require CPAN;
-
+#        'use'd at compile time, see above/maj
+#        require CPAN;
+
         # Save this because CPAN will chdir all over the place.
         my $cwd = Cwd::cwd();
-
+
+ # CPAN-install prereqs in the install set selected by the
+ # user when ./Build.PL or ./Build was run...unless the
+        # user's MyConfig.pm overrides.
+ # However, if Module::CoreList is available, install
+        # core module updates to the core install set (if the
+        # module was part of the core when the local Perl was
+        # installed...)
+ $$CPAN::Config{mbuildpl_arg} = "--installdirs ".$self->installdirs
+     unless $myconfig_mbuildpl_arg;
+ $$CPAN::Config{makepl_arg} = "INSTALLDIRS=".$self->installdirs
+     unless $myconfig_makepl_arg;
+ # if Module::CoreList is available, be clever...
+ if (eval "require Module::CoreList; 1") &&
+     (Module::CoreList->find_modules(qr/^$desired$/)) {
+  # in the core
+  if (Module::CoreList->first_release($desired) <= $]) {
+      # in the core of the local Perl installation
+      $$CPAN::Config{mbuildpl_arg} = "--installdirs core"
+   unless $myconfig_mbuildpl_arg;
+      $$CPAN::Config{makepl_arg} = "INSTALLDIRS=core"
+   unless $myconfig_makepl_arg;
+  }
+     }
+ }
+
         CPAN::Shell->install($desired);
         my $msg;
         my $expanded = CPAN::Shell->expand("Module", $desired);

----- Original Message ----- 
From: "Sendu Bala" <bix at sendu.me.uk>
To: "Mark A. Jensen" <maj at fortinbras.us>
Cc: "BioPerl List" <bioperl-l at bioperl.org>
Sent: Friday, January 23, 2009 12:35 PM
Subject: Re: [Bioperl-l] a thought on Bio::Root::Build


> Mark A. Jensen wrote:
>> Is it a reasonable convenience for the user who has run ./Build.PL
>> with a non-default set of install directories to ask CPAN::Shell
>> to use those directories when installing prerequisites (unless the user's 
>> MyConfig.pm is saying something else)?
>
> Seems like a good idea to me. If you've thought about it and are confident it 
> should be OK, go ahead and commit.
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>
> 



More information about the Bioperl-l mailing list