public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] [PATCH] repoman: checks deps of stable ebuilds for unstable configurations (bug 563546)
@ 2015-10-25 23:30 Zac Medico
  2015-10-26 11:24 ` Alexander Berntsen
  0 siblings, 1 reply; 2+ messages in thread
From: Zac Medico @ 2015-10-25 23:30 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Zac Medico

For ebuilds with stable keywords, check if the dependencies are
satisfiable for unstable configurations, since use.stable.mask
is not applied for unstable configurations. Fix the
KeywordsManager.isStable method to behave consistently for both
repoman and emerge.

X-Gentoo-Bug: 563546
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=563546
---
 .../package/ebuild/_config/KeywordsManager.py      | 35 ++++++++--------------
 pym/repoman/scanner.py                             | 10 +++++++
 2 files changed, 22 insertions(+), 23 deletions(-)

diff --git a/pym/portage/package/ebuild/_config/KeywordsManager.py b/pym/portage/package/ebuild/_config/KeywordsManager.py
index 72e24b9..a4ffb62 100644
--- a/pym/portage/package/ebuild/_config/KeywordsManager.py
+++ b/pym/portage/package/ebuild/_config/KeywordsManager.py
@@ -112,29 +112,18 @@ class KeywordsManager(object):
 		if self._getMissingKeywords(pkg, pgroups, mygroups):
 			return False
 
-		if pkg.cpv._settings.local_config:
-			# If replacing all keywords with unstable variants would mask the
-			# package, then it's considered stable.
-			unstable = []
-			for kw in mygroups:
-				if kw[:1] != "~":
-					kw = "~" + kw
-				unstable.append(kw)
-
-			return bool(self._getMissingKeywords(pkg, pgroups, set(unstable)))
-		else:
-			# For repoman, if the package has an effective stable keyword that
-			# intersects with the effective ACCEPT_KEYWORDS for the current
-			# profile, then consider it stable.
-			for kw in pgroups:
-				if kw[:1] != "~":
-					if kw in mygroups or '*' in mygroups:
-						return True
-					if kw == '*':
-						for x in mygroups:
-							if x[:1] != "~":
-								return True
-			return False
+		# If replacing all keywords with unstable variants would mask the
+		# package, then it's considered stable for the purposes of
+		# use.stable.mask/force interpretation. For unstable configurations,
+		# this guarantees that the effective use.force/mask settings for a
+		# particular ebuild do not change when that ebuild is stabilized.
+		unstable = []
+		for kw in mygroups:
+			if kw[:1] != "~":
+				kw = "~" + kw
+			unstable.append(kw)
+
+		return bool(self._getMissingKeywords(pkg, pgroups, set(unstable)))
 
 	def getMissingKeywords(self,
 							cpv,
diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index df46144..9e5a313 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -379,14 +379,24 @@ class Scanner(object):
 						else:
 							arches.add((keyword, arch, (arch, keyword)))
 					else:
+						# For ebuilds with stable keywords, check if the
+						# dependencies are satisfiable for unstable
+						# configurations, since use.stable.mask is not
+						# applied for unstable configurations (see bug
+						# 563546).
 						if keyword == "*":
 							for expanded_arch in self.profiles:
 								if expanded_arch == "**":
 									continue
 								arches.add(
 									(keyword, expanded_arch, (expanded_arch,)))
+								arches.add(
+									(keyword, expanded_arch,
+										(expanded_arch, "~" + expanded_arch)))
 						else:
 							arches.add((keyword, keyword, (keyword,)))
+							arches.add((keyword, keyword,
+								(keyword, "~" + keyword)))
 				if not arches:
 					# Use an empty profile for checking dependencies of
 					# packages that have empty KEYWORDS.
-- 
2.4.9



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

* Re: [gentoo-portage-dev] [PATCH] repoman: checks deps of stable ebuilds for unstable configurations (bug 563546)
  2015-10-25 23:30 [gentoo-portage-dev] [PATCH] repoman: checks deps of stable ebuilds for unstable configurations (bug 563546) Zac Medico
@ 2015-10-26 11:24 ` Alexander Berntsen
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Berntsen @ 2015-10-26 11:24 UTC (permalink / raw
  To: gentoo-portage-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

LGTM after also reading the bug report.

- -- 
Alexander
bernalex@gentoo.org
https://secure.plaimi.net/~alexander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCgAGBQJWLg1cAAoJENQqWdRUGk8BgnwP/RkxEdbu9iJ+W4ZbVl3nLwTa
4CTydF8dbUp7p2ayTFfvYcaeHOLcl4W7ip4kX03h2dii3UWMvkaHmJeWBuDkKQSw
y4h8XiYt/wzad1jW/CN51DA77duPTXGLU2NBdqVyKXjKbhefcb0ktbc/sqw0xQpR
xylzSuM5w8VLCflAA32Cf7yQpPZvw3emE6WN3/15l8vkZgpmOLk2rLefQPz02qmK
NrRZyGxLL2jsnG/LquN6zlZxukuPBlK1iaTZE1PAwQi09nsjrqyJHsrqjPh4d5TG
6sb1MQslfURmLyPOd8ZwKuWOS1gwobU+cz416qeGCiOWatdU5hKEQ8SKCbfULGYA
Ok6UAZUAU/2ypJhjUzCBlrdnIGgRhs7iuozZg55DtDfpnwMGW9qFau8WWyPJw4t+
pKZr07rzJNdmPAe5f+CBwHv2GeOQf79GVmQKp8rRUsLkN1jwc/wYsznUuhvaCowc
IP1n5Q+O16tWq1+TrRNMAtpuVusPhvBsU0g65qxuYQ+1dcpNA+V96QBsLPW+1lho
IL5v/MQhSwo0WdHw2K+qjucxkC9wlo6pzx/H+G1r9qsFg2ZZYhx2KEm6Ollw5b6W
/3Ekf784QxcM6sVsu+DdZumzP+v5ZgrtBrNF+8Lvc668Uo0iufzbsM8AYcVGKkQu
oF5KbEE1sxu1xayPFc6k
=tybL
-----END PGP SIGNATURE-----


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

end of thread, other threads:[~2015-10-26 11:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-25 23:30 [gentoo-portage-dev] [PATCH] repoman: checks deps of stable ebuilds for unstable configurations (bug 563546) Zac Medico
2015-10-26 11:24 ` Alexander Berntsen

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