Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 661276 - sys-apps/portage: make.conf PORTDIR setting fails to override /usr/portage in stage3
Summary: sys-apps/portage: make.conf PORTDIR setting fails to override /usr/portage in...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Configuration (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 240187 659322
  Show dependency tree
 
Reported: 2018-07-15 20:51 UTC by Zac Medico
Modified: 2018-10-12 19:32 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zac Medico gentoo-dev 2018-07-15 20:51:58 UTC
When a make.conf PORTDIR setting is used to override the default /usr/portage location in a stage3, and the location does not exist yet, it fails because profiles/repo_name doesn't exist and RepoConfig does not associate the PORTDIR location with the main repository here:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=9e1d8136e644281729e278b68e6272ab2954ee6f

This problem can be corrected by passing the main repo name into the RepoConfig constructor for PORTDIR:

> diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
> index bf2b6dd03..e45e67dec 100644
> --- a/pym/portage/repository/config.py
> +++ b/pym/portage/repository/config.py
> @@ -524,7 +524,8 @@ class RepoConfigLoader(object):
>  					(base_priority == 0 and ov is portdir):
>  					repo_opts = default_repo_opts.copy()
>  					repo_opts['location'] = ov
> -					repo = RepoConfig(None, repo_opts, local_config=local_config)
> +					name = prepos['DEFAULT'].main_repo if ov is portdir else None
> +					repo = RepoConfig(name, repo_opts, local_config=local_config)
>  					# repos_conf_opts contains options from repos.conf
>  					repos_conf_opts = repos_conf.get(repo.name)
>  					if repos_conf_opts is not None:
Comment 2 Larry the Git Cow gentoo-dev 2018-07-16 05:55:07 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=01f49cb12c66026e5b225912f9759b50ff2e2289

commit 01f49cb12c66026e5b225912f9759b50ff2e2289
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2018-07-15 20:55:48 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2018-07-16 05:53:05 +0000

    RepoConfig: fix make.conf PORTDIR override (bug 661276)
    
    Pass the main-repo name from repos.conf as the repository name
    for the PORTDIR RepoConfig constructor, so that it can override
    the main repo location even if the profiles/repo_name file does
    not exist yet (like in a stage3 tarball).
    
    Bug: https://bugs.gentoo.org/661276
    Reported-by: Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org>

 pym/portage/repository/config.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)