Re: [Module-build-general] PATCH: added ACTION_versioninstall
Status: Beta
Brought to you by:
kwilliams
|
From: Ken W. <ke...@ma...> - 2003-02-24 19:04:53
|
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.
I've also added a caution in the Changes file that the interface still
seems volatile.
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. =(
-Ken
|