X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FCPANPLUS%2FDist%2FGentoo.pm;h=3b37451d4bff10f5a1ab3eb40ed22cfa6453ef45;hb=99578d57a0086c534f0808f3bfc30849fb0511f4;hp=d7c1a7ff9924d733d680e8612dec7453456ed49f;hpb=410770eb10e4a998b5393317b9da84e19054eb35;p=perl%2Fmodules%2FCPANPLUS-Dist-Gentoo.git diff --git a/lib/CPANPLUS/Dist/Gentoo.pm b/lib/CPANPLUS/Dist/Gentoo.pm index d7c1a7f..3b37451 100644 --- a/lib/CPANPLUS/Dist/Gentoo.pm +++ b/lib/CPANPLUS/Dist/Gentoo.pm @@ -68,8 +68,8 @@ sub init { my $conf = $self->parent->parent->configure_object; $stat->mk_accessors(qw/name version dist desc uri src license deps - eb_name eb_version eb_dir eb_file distdir fetched_arch - keywords do_manifest + eb_name eb_version eb_dir eb_file fetched_arch + overlay distdir keywords do_manifest verbose/); $stat->verbose($conf->get_conf('verbose')); @@ -108,6 +108,7 @@ sub prepare { my $overlay = catdir(delete($opts{'overlay'}) || '/usr/local/portage', CATEGORY); + $stat->overlay($overlay); $stat->distdir(delete($opts{'distdir'}) || '/usr/portage/distfiles'); if ($stat->do_manifest && !-w $stat->distdir) { @@ -278,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) {