Skip to content

Commit

Permalink
detect PORTDIR & PORTDIR_OVERLAY by Portage::Q get_repos/get_repo_path
Browse files Browse the repository at this point in the history
 if they not comes from env
this commit should fix gentoo bug #581490 and fix gentoo-perl#26 (github)
  • Loading branch information
bor committed Nov 11, 2016
1 parent 346f374 commit d520137
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/App/gcpan.pm
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,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;
}

Expand Down

0 comments on commit d520137

Please sign in to comment.