Re: [Module-build-general] PATCH: added ACTION_versioninstall
Status: Beta
Brought to you by:
kwilliams
|
From: Brian I. <in...@tt...> - 2003-02-24 20:22:53
|
On 24/02/03 13:04 -0600, Ken Williams wrote:
>
> On Sunday, February 23, 2003, at 08:20 PM, Brian Ingerson wrote:
>
> > On 19/02/03 20:43 -0600, Ken Williams wrote:
> >> 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?
> >
> > And now for that patch I promised. Sorry I took so long, but you
> > challenged me to go back and refactor only.pm, which I did a whole
> > bunch
> > of. I think you'll find the new patch to be much cleaner :)
>
> Here's how I'm applying it:
>
> sub ACTION_versioninstall {
> my ($self) = @_;
>
> die "You must have only.pm 0.25 or greater installed for this
> operation: $@\n"
> unless eval { require only; 'only'->VERSION(0.25); 1 };
>
> $self->depends_on('build');
>
> my %onlyargs = map {exists($self->{args}{$_}) ? ($_ =>
> $self->{args}{$_}) : ()}
> qw(version versionlib);
> only::install::install(%onlyargs);
> }
>
> There might be other things in the $self->{args} hash that you don't
> want to pass to only::install::install(), so I had to check for
> specific keys.
ok, but...
I had it that way on purpose because only::install::install ignores
unknown parameters. That way it could be forward compatible with new
only::install args.
but, that's fine, because I'd still want to patch the M::B docs for the
new args.
Thanks for applying.
> I've also added a caution in the Changes file that the interface still
> seems volatile.
How so?
(Show me a failing test, and I'll show you a patch! ;)
> If I had more time I'd offer some feedback on the OO interface, but
> unfortunately I'm up against a bit of a time wall here. =(
Yeah well, no problem. We all have lots to do!
I put the OO interface into the latest release: only-0.25. I also
refactored the internals to use the same OO interface. I'm pretty happy
with how it all turned out.
But I'd love to hear your comments someday. :)
Cheers, Brian
|