public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Zac Medico <zmedico@gentoo.org>
To: gentoo-portage-dev@lists.gentoo.org
Cc: Zac Medico <zmedico@gentoo.org>
Subject: [gentoo-portage-dev] [PATCH] repoman: checks deps of stable ebuilds for unstable configurations (bug 563546)
Date: Sun, 25 Oct 2015 16:30:49 -0700	[thread overview]
Message-ID: <1445815849-26954-1-git-send-email-zmedico@gentoo.org> (raw)

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



             reply	other threads:[~2015-10-25 23:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-25 23:30 Zac Medico [this message]
2015-10-26 11:24 ` [gentoo-portage-dev] [PATCH] repoman: checks deps of stable ebuilds for unstable configurations (bug 563546) Alexander Berntsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1445815849-26954-1-git-send-email-zmedico@gentoo.org \
    --to=zmedico@gentoo.org \
    --cc=gentoo-portage-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox