On Thu, 12 Jul 2018 02:59:03 -0700
Zac Medico <zmed...@gentoo.org> wrote:

> Account for repoman modifications of the portdbapi self.settings
> reference, and treat all flags as valid for the empty profile
> because it does not have any implicit IUSE settings.
> 
> Bug: https://bugs.gentoo.org/660982
> ---
>  pym/_emerge/Package.py        |  5 ++++-
>  pym/portage/dbapi/__init__.py | 16 ++++++++++++++++
>  2 files changed, 20 insertions(+), 1 deletion(-)
> 
> diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
> index a7ce00bc9..5f34f3d27 100644
> --- a/pym/_emerge/Package.py
> +++ b/pym/_emerge/Package.py
> @@ -93,7 +93,10 @@ class Package(Task):
>               # sync metadata with validated repo (may be
> UNKNOWN_REPO) self._metadata['repository'] = self.cpv.repo
>  
> -             implicit_match = db._iuse_implicit_cnstr(self.cpv,
> self._metadata)
> +             if self.root_config.settings.local_config:
> +                     implicit_match =
> db._iuse_implicit_cnstr(self.cpv, self._metadata)
> +             else:
> +                     implicit_match =
> db._repoman_iuse_implicit_cnstr(self.cpv, self._metadata) usealiases
> = self.root_config.settings._use_manager.getUseAliases(self)
> self.iuse = self._iuse(self, self._metadata["IUSE"].split(),
> implicit_match, usealiases, self.eapi) diff --git
> a/pym/portage/dbapi/__init__.py b/pym/portage/dbapi/__init__.py index
> d320cc75f..61d301839 100644 --- a/pym/portage/dbapi/__init__.py
> +++ b/pym/portage/dbapi/__init__.py
> @@ -216,6 +216,22 @@ class dbapi(object):
>  
>                       yield cpv
>  
> +     def _repoman_iuse_implicit_cnstr(self, pkg, metadata):
> +             """
> +             In repoman's version of _iuse_implicit_cnstr,
> account for modifications
> +             of the self.settings reference between calls, and
> treat all flags as
> +             valid for the empty profile because it does not have
> any implicit IUSE
> +             settings. See bug 660982.
> +             """
> +             eapi_attrs = _get_eapi_attrs(metadata["EAPI"])
> +             if eapi_attrs.iuse_effective:
> +                     iuse_implicit_match = lambda flag: (True if
> not self.settings.profile_path
> +                             else
> self.settings._iuse_effective_match(flag))
> +             else:
> +                     iuse_implicit_match = lambda flag: (True if
> not self.settings.profile_path
> +                             else
> self.settings._iuse_implicit_match(flag))
> +             return iuse_implicit_match
> +
>       def _iuse_implicit_cnstr(self, pkg, metadata):
>               """
>               Construct a callable that checks if a given USE flag
> should

looks good thanks.

Please add the test case ebuild that was supplied to the repoman
gen-b0rk repo "not-broken" category.

https://gitweb.gentoo.org/repo/proj/gen-b0rk.git/

-- 
Brian Dolbec <dolsen>


Reply via email to