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 ) id 1SiGCj-0002XJ-LY for garchives@archives.gentoo.org; Sat, 23 Jun 2012 02:36:05 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B6E5FE0AE4; Sat, 23 Jun 2012 02:35:56 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 51C46E0AE4 for ; Sat, 23 Jun 2012 02:35:56 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 609EE1B4022 for ; Sat, 23 Jun 2012 02:35:55 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 24796E5435 for ; Sat, 23 Jun 2012 02:35:53 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1340418942.04f6d3402f671aae275a0408ee2a6cdd9cd74e7a.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: 04f6d3402f671aae275a0408ee2a6cdd9cd74e7a X-VCS-Branch: master Date: Sat, 23 Jun 2012 02:35:53 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 6651978b-a76f-4468-9584-b0c5606eb680 X-Archives-Hash: 6325be2b016dc75f5aa00e3f89349e98 commit: 04f6d3402f671aae275a0408ee2a6cdd9cd74e7a Author: Zac Medico gentoo org> AuthorDate: Sat Jun 23 02:35:42 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Sat Jun 23 02:35:42 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D04f6d340 depgraph: fix bugs in force_reinstall handling --- pym/_emerge/depgraph.py | 86 ++++++++++++++++++++---------------------= ----- 1 files changed, 37 insertions(+), 49 deletions(-) diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 92c1061..b3ea964 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -1849,16 +1849,11 @@ class depgraph(object): self._dynamic_config._slot_pkg_map[dep.child.root].get( dep.child.slot_atom) is None: myarg =3D None - if dep.root =3D=3D self._frozen_config.target_root: - try: - myarg =3D next(self._iter_atoms_for_pkg(dep.child)) - except StopIteration: - pass - except InvalidDependString: - if not dep.child.installed: - # This shouldn't happen since the package - # should have been masked. - raise + try: + myarg =3D next(self._iter_atoms_for_pkg(dep.child), None) + except InvalidDependString: + if not dep.child.installed: + raise =20 if myarg is None: # Existing child selection may not be valid unless @@ -1964,14 +1959,11 @@ class depgraph(object): self._dynamic_config._slot_pkg_map[dep.child.root].get( dep.child.slot_atom) is None: myarg =3D None - if dep.root =3D=3D self._frozen_config.target_root: - try: - myarg =3D next(self._iter_atoms_for_pkg(dep.child)) - except StopIteration: - pass - except InvalidDependString: - if not dep.child.installed: - raise + try: + myarg =3D next(self._iter_atoms_for_pkg(dep.child), None) + except InvalidDependString: + if not dep.child.installed: + raise =20 if myarg is None: ignored =3D True @@ -3782,20 +3774,22 @@ class depgraph(object): True if the user has not explicitly requested for this package to be replaced (typically via an atom on the command line). """ - if "selective" not in self._dynamic_config.myparams and \ - pkg.root =3D=3D self._frozen_config.target_root: - if self._frozen_config.excluded_pkgs.findAtomForPackage(pkg, - modified_use=3Dself._pkg_use_enabled(pkg)): - return True - try: - next(self._iter_atoms_for_pkg(pkg)) - except StopIteration: - pass - except portage.exception.InvalidDependString: - pass - else: - return False - return True + if self._frozen_config.excluded_pkgs.findAtomForPackage(pkg, + modified_use=3Dself._pkg_use_enabled(pkg)): + return True + + arg =3D False + try: + for arg, atom in self._iter_atoms_for_pkg(pkg): + if arg.force_reinstall: + return False + except InvalidDependString: + pass + + if "selective" in self._dynamic_config.myparams: + return True + + return not arg =20 class _AutounmaskLevel(object): __slots__ =3D ("allow_use_changes", "allow_unstable_keywords", "allow_= license_changes", \ @@ -4249,16 +4243,15 @@ class depgraph(object): # above visibility checks are complete. =20 myarg =3D None - if root =3D=3D self._frozen_config.target_root: - try: - for myarg, myarg_atom in self._iter_atoms_for_pkg(pkg): - if myarg.force_reinstall: - reinstall =3D True - break - except portage.exception.InvalidDependString: - if not installed: - # masked by corruption - continue + try: + for myarg, myarg_atom in self._iter_atoms_for_pkg(pkg): + if myarg.force_reinstall: + reinstall =3D True + break + except InvalidDependString: + if not installed: + # masked by corruption + continue if not installed and myarg: found_available_arg =3D True =20 @@ -7107,13 +7100,8 @@ class _dep_check_composite_db(dbapi): return ret[:] =20 def _visible(self, pkg): - if pkg.installed and "selective" not in self._depgraph._dynamic_config= .myparams: - try: - arg =3D next(self._depgraph._iter_atoms_for_pkg(pkg)) - except (StopIteration, portage.exception.InvalidDependString): - arg =3D None - if arg: - return False + if pkg.installed and not self._depgraph._want_installed_pkg(pkg): + return False if pkg.installed and \ (pkg.masks or not self._depgraph._pkg_visibility_check(pkg)): # Account for packages with masks (like KEYWORDS masks)