public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:multilib commit in: pym/portage/dep/, pym/_emerge/
Date: Sun,  5 May 2013 16:22:49 +0000 (UTC)	[thread overview]
Message-ID: <1367770876.77148a829f21bd353d39ccf00def9ed515b5bbfc.zmedico@gentoo> (raw)

commit:     77148a829f21bd353d39ccf00def9ed515b5bbfc
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat May  4 20:02:25 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May  5 16:21:16 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=77148a82

Make multilib atoms consistent, so rebuilds work.

The atoms need to be consistent so that the "unevaluated_atom
not in selected_atoms" code from commit
ef125a7885f4f5a614265f3f8a97803f6a8c1264 works properly.

---
 pym/_emerge/Package.py       |   26 ++++++++++++++++++++++++++
 pym/portage/dep/dep_check.py |   29 ++++++++++++++++-------------
 2 files changed, 42 insertions(+), 13 deletions(-)

diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
index 022a98c..96fbc9c 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -258,6 +258,32 @@ class Package(Task):
 								(atom.unevaluated_atom,))
 							self._metadata_exception(k, e)
 
+		if not self.built and self.root_config.settings.local_config and \
+			'force-multilib' in self.root_config.settings.features:
+			mysettings = self.root_config.settings
+			no_auto_flag = frozenset(mysettings.get("NO_AUTO_FLAG", "").split())
+			for i, x in enumerate(validated_atoms):
+				if not isinstance(x, portage.dep.Atom):
+					continue
+				if x.cp in no_auto_flag:
+					continue
+				multilib_flags = []
+				for multilib_abis in mysettings.get("MULTILIB_ABIS", '').split():
+					multilib_flag = 'multilib_abi_' + multilib_abis
+					if x.unevaluated_atom.use is None or \
+						x.unevaluated_atom.use.conditional is None or \
+						multilib_flag not in x.unevaluated_atom.use.conditional.enabled:
+						multilib_flags.append(multilib_flag + '?')
+				if multilib_flags:
+					if x.unevaluated_atom.use is None:
+						use_tokens = []
+					else:
+						use_tokens = list(x.unevaluated_atom.use.tokens)
+					use_tokens.extend(multilib_flags)
+					validated_atoms[i] =  portage.dep.Atom(
+						x.unevaluated_atom.without_use + \
+						"[%s]" % (",".join(use_tokens)))
+
 		self._validated_atoms = tuple(set(atom for atom in
 			validated_atoms if isinstance(atom, Atom)))
 

diff --git a/pym/portage/dep/dep_check.py b/pym/portage/dep/dep_check.py
index 325d6b4..380bb3f 100644
--- a/pym/portage/dep/dep_check.py
+++ b/pym/portage/dep/dep_check.py
@@ -69,20 +69,23 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
 			x = x._eval_qa_conditionals(use_mask, use_force)
 
 		if 'force-multilib' in mysettings.features:
-			if not repoman :
+			if not repoman and x.cp not in mysettings.get("NO_AUTO_FLAG", "").split():
+				multilib_flags = []
 				for multilib_abis in mysettings.get("MULTILIB_ABIS", '').split():
-					if multilib_abis not in ("multilib_abi_" + x) and portage.dep_getkey(x) not in mysettings.get("NO_AUTO_FLAG", None):
-						if ']' in x:
-							x = str(x).replace(']',',multilib_abi_' + multilib_abis + '?]')
-						else:
-							x = str(x) + '[multilib_abi_' + multilib_abis + '?]'
-						try:
-							x = portage.dep.Atom(x)
-							x = x.evaluate_conditionals(myuse)
-						except portage.exception.InvalidAtom:
-							if portage.dep._dep_check_strict:
-								raise portage.exception.ParseError(
-									"invalid atom: '%s'" % x)
+					multilib_flag = 'multilib_abi_' + multilib_abis
+					if x.unevaluated_atom.use is None or \
+						x.unevaluated_atom.use.conditional is None or \
+						multilib_flag not in x.unevaluated_atom.use.conditional.enabled:
+						multilib_flags.append(multilib_flag + '?')
+				if multilib_flags:
+					if x.unevaluated_atom.use is None:
+						use_tokens = []
+					else:
+						use_tokens = list(x.unevaluated_atom.use.tokens)
+					use_tokens.extend(multilib_flags)
+					x = portage.dep.Atom(x.unevaluated_atom.without_use +
+						"[%s]" % (",".join(use_tokens)))
+					x = x.evaluate_conditionals(myuse)
 
 		mykey = x.cp
 		if not mykey.startswith("virtual/"):


             reply	other threads:[~2013-05-05 16:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-05 16:22 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-05-05 16:42 [gentoo-commits] proj/portage:multilib commit in: pym/portage/dep/, pym/_emerge/ Zac Medico
2013-05-05 16:26 Zac Medico
2013-05-04 20:07 Zac Medico

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=1367770876.77148a829f21bd353d39ccf00def9ed515b5bbfc.zmedico@gentoo \
    --to=zmedico@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-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