From: Vincent Pit Date: Sat, 29 Nov 2008 16:43:38 +0000 (+0100) Subject: Set PORTDIR_OVERLAY and PORTAGE_RO_DISTDIRS to their appropriate values before runnin... X-Git-Tag: v0.03~8 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FCPANPLUS-Dist-Gentoo.git;a=commitdiff_plain;h=99578d57a0086c534f0808f3bfc30849fb0511f4 Set PORTDIR_OVERLAY and PORTAGE_RO_DISTDIRS to their appropriate values before running commands --- diff --git a/lib/CPANPLUS/Dist/Gentoo.pm b/lib/CPANPLUS/Dist/Gentoo.pm index 26703a4..3b37451 100644 --- a/lib/CPANPLUS/Dist/Gentoo.pm +++ b/lib/CPANPLUS/Dist/Gentoo.pm @@ -279,8 +279,14 @@ sub uninstall { sub _run { my ($self, $cmd, $verbose) = @_; + my $stat = $self->status; + + my ($success, $errmsg, $output) = do { + local $ENV{PORTDIR_OVERLAY} = $stat->overlay; + local $ENV{PORTAGE_RO_DISTDIRS} = $stat->distdir; + run command => $cmd, verbose => $verbose; + }; - my ($success, $errmsg, $output) = run command => $cmd, verbose => $verbose; unless ($success) { error "$errmsg -- aborting"; if (not $verbose and defined $output and $self->status->verbose) {