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

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