From 8bc61b700b63eaeac6a1699560bbf3c81b9d38b0 Mon Sep 17 00:00:00 2001 From: Sergiy Borodych Date: Thu, 10 Nov 2016 18:11:37 +0200 Subject: [PATCH] detect PORTDIR & PORTDIR_OVERLAY by Portage::Q get_repos/get_repo_path if they not comes from env this commit should fix gentoo bug #581490 and fix #26 (github) --- lib/App/gcpan.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/App/gcpan.pm b/lib/App/gcpan.pm index efd0305..a94658d 100644 --- a/lib/App/gcpan.pm +++ b/lib/App/gcpan.pm @@ -57,6 +57,15 @@ sub setup_env { PORTDIR_OVERLAY => $portageq->envvar('PORTDIR_OVERLAY'), ); + # retrive PORTDIR & PORTDIR_OVERLAY from repos.conf if they not set in make.conf + $env{PORTDIR} ||= $portageq->get_repo_path( $portageq->envvar('EROOT'), 'gentoo' ); + unless ( $env{PORTDIR_OVERLAY} ) { + my $eroot = $portageq->envvar('EROOT'); + my $repos = $portageq->get_repos($eroot); + $env{PORTDIR_OVERLAY} = join ' ', + map { $portageq->get_repo_path( $eroot, $_ ) } grep { $_ ne 'gentoo' } @$repos; + } + return \%env; }