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 1QP4Eb-00053b-51 for garchives@archives.gentoo.org; Wed, 25 May 2011 02:54:09 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 85A281C002; Wed, 25 May 2011 02:54:00 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 3DFA91C002 for ; Wed, 25 May 2011 02:54:00 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7B7251B4027 for ; Wed, 25 May 2011 02:53:59 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id A735280505 for ; Wed, 25 May 2011 02:53:58 +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: <20498936b79906dfcb31a84cfd9e97ee20c94147.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: 20498936b79906dfcb31a84cfd9e97ee20c94147 Date: Wed, 25 May 2011 02:53:58 +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: X-Archives-Hash: f2bc0281fcbaab66ab5affc32d666db7 commit: 20498936b79906dfcb31a84cfd9e97ee20c94147 Author: Zac Medico gentoo org> AuthorDate: Wed May 25 02:52:17 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Wed May 25 02:52:17 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D20498936 depgraph: detect deps broken by autounmask This will fix bug #368429. --- pym/_emerge/depgraph.py | 38 +++++++++++++++++++++++++++++++++++++- 1 files changed, 37 insertions(+), 1 deletions(-) diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 3463925..fec2377 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -2740,15 +2740,18 @@ class depgraph(object): =20 =20 def _show_unsatisfied_dep(self, root, atom, myparent=3DNone, arg=3DNone= , - check_backtrack=3DFalse): + check_backtrack=3DFalse, check_autounmask_breakage=3DFalse): """ When check_backtrack=3DTrue, no output is produced and the method either returns or raises _backtrack_mask if a matching package has been masked by backtracking. """ backtrack_mask =3D False + autounmask_broke_use_dep =3D False atom_set =3D InternalPackageSet(initial_atoms=3D(atom.without_use,), allow_repo=3DTrue) + atom_set_with_use =3D InternalPackageSet(initial_atoms=3D(atom,), + allow_repo=3DTrue) xinfo =3D '"%s"' % atom.unevaluated_atom if arg: xinfo=3D'"%s"' % arg @@ -2823,6 +2826,8 @@ class depgraph(object): or atom.violated_conditionals(self._pkg_use_enabled(pkg), pkg.i= use.is_valid_flag).use: missing_use.append(pkg) if not mreasons: + if atom_set_with_use.findAtomForPackage(pkg): + autounmask_broke_use_dep =3D True continue except InvalidAtom: writemsg("violated_conditionals raised " + \ @@ -2855,6 +2860,12 @@ class depgraph(object): else: return =20 + if check_autounmask_breakage: + if autounmask_broke_use_dep: + raise self._autounmask_breakage() + else: + return + missing_use_reasons =3D [] missing_iuse_reasons =3D [] for pkg in missing_use: @@ -6342,6 +6353,13 @@ class depgraph(object): backtracking. """ =20 + class _autounmask_breakage(_internal_exception): + """ + This is raised by _show_unsatisfied_dep() when it's called with + check_autounmask_breakage=3DTrue and a matching package has been + been disqualified due to autounmask changes. + """ + def need_restart(self): return self._dynamic_config._need_restart and \ not self._dynamic_config._skip_restart @@ -6349,6 +6367,15 @@ class depgraph(object): def success_without_autounmask(self): return self._dynamic_config._success_without_autounmask =20 + def autounmask_breakage_detected(self): + try: + for pargs, kwargs in self._dynamic_config._unsatisfied_deps_for_displ= ay: + self._show_unsatisfied_dep( + *pargs, check_autounmask_breakage=3DTrue, **kwargs) + except self._autounmask_breakage: + return True + return False + def get_backtrack_infos(self): return self._dynamic_config._backtrack_infos =09 @@ -6640,6 +6667,15 @@ def _backtrack_depgraph(settings, trees, myopts, m= yparams, myaction, myfiles, sp allow_backtracking=3DFalse, backtrack_parameters=3Dbacktracker.get_best_run()) success, favorites =3D mydepgraph.select_files(myfiles) + if not success and mydepgraph.autounmask_breakage_detected(): + if "--debug" in myopts: + writemsg_level( + "\n\nautounmask breakage detectedn\n", + noiselevel=3D-1, level=3Dlogging.DEBUG) + myopts["--autounmask"] =3D "n" + mydepgraph =3D depgraph(settings, trees, myopts, myparams, spinner, + frozen_config=3Dfrozen_config, allow_backtracking=3DFalse) + success, favorites =3D mydepgraph.select_files(myfiles) =20 return (success, mydepgraph, favorites) =20