Re: [Module-build-general] PATCH: added ACTION_versioninstall
Status: Beta
Brought to you by:
kwilliams
From: Ken W. <ke...@ma...> - 2003-02-20 02:43:43
|
Applied! I think the fact that $only::config::versionlib, $only::config::versionarch, and @ARGV need to be manipulated dynamically means that only.pm needs a little interface work, though - do you plan on adding a programmatic interface that could just accept this stuff as arguments? -Ken On Wednesday, February 19, 2003, at 07:24 PM, Brian Ingerson wrote: > Here's a patch to make: > > ./Build versioninstall work. > > Cheers, Brian > > > diff -ru Module-Build-0.15-orig/lib/Module/Build/Base.pm > Module-Build-0.15/lib/Module/Build/Base.pm > --- Module-Build-0.15-orig/lib/Module/Build/Base.pm Fri Jan 17 > 12:53:11 2003 > +++ Module-Build-0.15/lib/Module/Build/Base.pm Wed Feb 19 17:01:52 2003 > @@ -761,6 +761,28 @@ > ExtUtils::Install::install($self->install_map('blib'), 1, 1); > } > > +sub ACTION_versioninstall { > + my ($self) = @_; > + eval { require only }; > + die "You must have only.pm installed for this operation\n" > + if $@; > + > + if (defined $self->{args}{versionlib}) { > + require Config; > + $only::config::versionlib = $self->{args}{versionlib}; > + $only::config::versionarch = > + File::Spec->catdir($self->{args}{versionlib}, > + $Config::Config{archname}); > + } > + my @args = (); > + if (defined $self->{args}{version}) { > + push @args, $self->{args}{version}; > + } > + $self->depends_on('build'); > + local @ARGV = @args; > + only::install(); > +} > + > sub ACTION_clean { > my ($self) = @_; > foreach my $item (keys %{$self->{cleanup}}) { > diff -ru Module-Build-0.15-orig/lib/Module/Build.pm > Module-Build-0.15/lib/Module/Build.pm > --- Module-Build-0.15-orig/lib/Module/Build.pm Fri Jan 17 13:11:05 2003 > +++ Module-Build-0.15/lib/Module/Build.pm Wed Feb 19 16:46:26 2003 > @@ -733,6 +733,28 @@ > anything, it will just report what it I<would> have done if you had > actually run the C<install> action. > > +=item versioninstall > + > +If you have C<only.pm> installed on your system, you can use this > action > +to install a module into the version specific library trees. This > means > +that you can have several versions of the same module installed and > +C<use> a specific one like this: > + > + use only MyModule => 0.55; > + > +To override the default installation libraries in C<only::config>, > +specify the C<versionlib> parameter when you run the C<Build.PL> > script: > + > + perl Build.PL versionlib=/my/version/place/ > + > +To override which version the module is installed as, specify the > +C<versionlib> parameter when you run the C<Build.PL> script: > + > + perl Build.PL version=0.50 > + > +See the C<only.pm> documentation for more information on version > +specific installs. > + > =item manifest > > This is an action intended for use by module authors, not people > Only in Module-Build-0.15: x > > > ------------------------------------------------------- > This SF.net email is sponsored by: SlickEdit Inc. Develop an edge. > The most comprehensive and flexible code editor you can use. > Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial. > www.slickedit.com/sourceforge > _______________________________________________ > Module-build-general mailing list > Mod...@li... > https://lists.sourceforge.net/lists/listinfo/module-build-general > -Ken |