public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] [PATCH] dbapi: fix repoman implicit IUSE (bug 660982)
@ 2018-07-12  9:59 Zac Medico
  2018-07-12 13:36 ` Brian Dolbec
  0 siblings, 1 reply; 3+ messages in thread
From: Zac Medico @ 2018-07-12  9:59 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Zac Medico

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
-- 
2.13.6



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [gentoo-portage-dev] [PATCH] dbapi: fix repoman implicit IUSE (bug 660982)
  2018-07-12  9:59 [gentoo-portage-dev] [PATCH] dbapi: fix repoman implicit IUSE (bug 660982) Zac Medico
@ 2018-07-12 13:36 ` Brian Dolbec
  2018-07-14 23:52   ` Zac Medico
  0 siblings, 1 reply; 3+ messages in thread
From: Brian Dolbec @ 2018-07-12 13:36 UTC (permalink / raw
  To: gentoo-portage-dev

On Thu, 12 Jul 2018 02:59:03 -0700
Zac Medico <zmedico@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>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-portage-dev] [PATCH] dbapi: fix repoman implicit IUSE (bug 660982)
  2018-07-12 13:36 ` Brian Dolbec
@ 2018-07-14 23:52   ` Zac Medico
  0 siblings, 0 replies; 3+ messages in thread
From: Zac Medico @ 2018-07-14 23:52 UTC (permalink / raw
  To: gentoo-portage-dev, Brian Dolbec


[-- Attachment #1.1: Type: text/plain, Size: 3253 bytes --]

On 07/12/2018 06:36 AM, Brian Dolbec wrote:
> On Thu, 12 Jul 2018 02:59:03 -0700
> Zac Medico <zmedico@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.

Thanks, merged:

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

> 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/

Well, these ebuilds are broken in the sense that they normally produce
these results:

RepoMan scours the neighborhood...
  KEYWORDS.missing              1
   net-im/a/a-0.ebuild
  KEYWORDS.unsorted             1
   net-im/b/b-0.ebuild contains unsorted keywords
  metadata.missing [fatal]      2
   net-im/a/metadata.xml
   net-im/b/metadata.xml
-- 
Thanks,
Zac


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 981 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-14 23:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-12  9:59 [gentoo-portage-dev] [PATCH] dbapi: fix repoman implicit IUSE (bug 660982) Zac Medico
2018-07-12 13:36 ` Brian Dolbec
2018-07-14 23:52   ` Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox