From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org)
	by finch.gentoo.org with esmtp (Exim 4.60)
	(envelope-from <gentoo-commits+bounces-419303-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1RoL5w-0005Lk-W7
	for garchives@archives.gentoo.org; Fri, 20 Jan 2012 20:29:57 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 0325DE0985;
	Fri, 20 Jan 2012 20:29:47 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	by pigeon.gentoo.org (Postfix) with ESMTP id ADCCAE0985
	for <gentoo-commits@lists.gentoo.org>; Fri, 20 Jan 2012 20:29:47 +0000 (UTC)
Received: from pelican.gentoo.org (unknown [66.219.59.40])
	(using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 1F5F01B400A
	for <gentoo-commits@lists.gentoo.org>; Fri, 20 Jan 2012 20:29:47 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by pelican.gentoo.org (Postfix) with ESMTP id 48C1880042
	for <gentoo-commits@lists.gentoo.org>; Fri, 20 Jan 2012 20:29:46 +0000 (UTC)
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" <zmedico@gentoo.org>
Message-ID: <a77292d37e3c2604479514abed2dda64dabace25.zmedico@gentoo>
Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/
X-VCS-Repository: proj/portage
X-VCS-Files: pym/_emerge/depgraph.py
X-VCS-Directories: pym/_emerge/
X-VCS-Committer: zmedico
X-VCS-Committer-Name: Zac Medico
X-VCS-Revision: a77292d37e3c2604479514abed2dda64dabace25
Date: Fri, 20 Jan 2012 20:29:46 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: quoted-printable
X-Archives-Salt: cc2d7cb3-f4ef-4050-9c44-4bd6cdb6a252
X-Archives-Hash: 2c8ac61fef01cd2e676eba48bb2e405d

commit:     a77292d37e3c2604479514abed2dda64dabace25
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 20 20:29:31 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jan 20 20:29:31 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a=
=3Dcommit;h=3Da77292d3

Fix --changed-use interaction with bug 297549.

The automatic --binpkg-respect-use code (from bug #297549) was
inappropriately overriding --changed-use and triggering behavior like
--newuse, as reported here:

http://archives.gentoo.org/gentoo-dev/msg_6070ab87737d7e16a5cec2a72c9111f=
d.xml

---
 pym/_emerge/depgraph.py |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 0c9e5f2..6d0ba1c 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -827,20 +827,28 @@ class depgraph(object):
 					else:
 						self._dynamic_config._slot_conflict_parent_atoms.add(parent_atom)
=20
-	def _reinstall_for_flags(self, forced_flags,
+	def _reinstall_for_flags(self, pkg, forced_flags,
 		orig_use, orig_iuse, cur_use, cur_iuse):
 		"""Return a set of flags that trigger reinstallation, or None if there
 		are no such flags."""
-		if "--newuse" in self._frozen_config.myopts or \
-			self._dynamic_config.myparams.get(
-			"binpkg_respect_use") in ("y", "auto"):
+
+		# binpkg_respect_use: Behave like newuse by default. If newuse is
+		# False and changed_use is True, then behave like changed_use.
+		binpkg_respect_use =3D (pkg.built and
+			self._dynamic_config.myparams.get("binpkg_respect_use")
+			in ("y", "auto"))
+		newuse =3D "--newuse" in self._frozen_config.myopts
+		changed_use =3D "changed-use" =3D=3D self._frozen_config.myopts.get("-=
-reinstall")
+
+		if newuse or (binpkg_respect_use and not changed_use):
 			flags =3D set(orig_iuse.symmetric_difference(
 				cur_iuse).difference(forced_flags))
 			flags.update(orig_iuse.intersection(orig_use).symmetric_difference(
 				cur_iuse.intersection(cur_use)))
 			if flags:
 				return flags
-		elif "changed-use" =3D=3D self._frozen_config.myopts.get("--reinstall"=
):
+
+		elif changed_use or binpkg_respect_use:
 			flags =3D orig_iuse.intersection(orig_use).symmetric_difference(
 				cur_iuse.intersection(cur_use))
 			if flags:
@@ -4039,8 +4047,8 @@ class depgraph(object):
 						cur_iuse =3D iuses
 						if myeb and not usepkgonly and not useoldpkg:
 							cur_iuse =3D myeb.iuse.all
-						reinstall_for_flags =3D self._reinstall_for_flags(forced_flags,
-							old_use, iuses, now_use, cur_iuse)
+						reinstall_for_flags =3D self._reinstall_for_flags(pkg,
+							forced_flags, old_use, iuses, now_use, cur_iuse)
 						if reinstall_for_flags:
 							if not pkg.installed:
 								self._dynamic_config.ignored_binaries.setdefault(pkg, set()).upd=
ate(reinstall_for_flags)
@@ -4060,7 +4068,7 @@ class depgraph(object):
 						cur_use =3D self._pkg_use_enabled(pkg)
 						cur_iuse =3D pkg.iuse.all
 						reinstall_for_flags =3D \
-							self._reinstall_for_flags(
+							self._reinstall_for_flags(pkg,
 							forced_flags, old_use, old_iuse,
 							cur_use, cur_iuse)
 						if reinstall_for_flags: