From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id B62EE1381F3 for ; Fri, 2 Aug 2013 08:54:53 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6E1E2E0A00; Fri, 2 Aug 2013 08:54:52 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id EDB9CE0A00 for ; Fri, 2 Aug 2013 08:54:51 +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 D81A733EA13 for ; Fri, 2 Aug 2013 08:54:50 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 0DEDFE468F for ; Fri, 2 Aug 2013 08:54:47 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1375433665.f3b89e80bc5779a784427b1435758c0f88946c05.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: f3b89e80bc5779a784427b1435758c0f88946c05 X-VCS-Branch: master Date: Fri, 2 Aug 2013 08:54:47 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 52628a4e-3139-4edd-88dc-f3f9ff019472 X-Archives-Hash: 89cd0e0c7f8167cbe1f958ddb603f234 commit: f3b89e80bc5779a784427b1435758c0f88946c05 Author: Zac Medico gentoo org> AuthorDate: Fri Aug 2 08:54:25 2013 +0000 Commit: Zac Medico gentoo org> CommitDate: Fri Aug 2 08:54:25 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f3b89e80 _slot_confict_backtrack: simplify code The order of backtrack_data is simply based on version comparison since commit 9b6f69e2a66c0f1d1d6545208edb3c45eacfd845. --- pym/_emerge/depgraph.py | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 39ae3ea..4f9d0f0 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -6,7 +6,6 @@ from __future__ import print_function, unicode_literals import errno import io import logging -import operator import stat import sys import textwrap @@ -959,20 +958,11 @@ class depgraph(object): debug = "--debug" in self._frozen_config.myopts existing_node = self._dynamic_config._slot_pkg_map[root][slot_atom] + # In order to avoid a missed update, first mask lower versions + # that conflict with higher versions (the backtracker visits + # these in reverse order). + conflict_pkgs.sort(reverse=True) backtrack_data = [] - # The ordering of backtrack_data can make - # a difference here, because both mask actions may lead - # to valid, but different, solutions and the one with - # 'existing_node' masked is usually the better one. Because - # of that, we choose an order such that - # the backtracker will first explore the choice with - # existing_node masked. The backtracker reverses the - # order, so the order it uses is the reverse of the - # order shown here. See bug #339606. - if existing_node in conflict_pkgs and \ - existing_node is not conflict_pkgs[-1]: - conflict_pkgs.remove(existing_node) - conflict_pkgs.append(existing_node) for to_be_masked in conflict_pkgs: # For missed update messages, find out which # atoms matched to_be_selected that did not @@ -983,11 +973,6 @@ class depgraph(object): if parent_atom not in parent_atoms) backtrack_data.append((to_be_masked, conflict_atoms)) - if len(backtrack_data) > 1: - # In order to avoid a missed update, first mask lower - # versions that conflict with higher versions. - backtrack_data.sort(key=operator.itemgetter(0), reverse=True) - to_be_masked = backtrack_data[-1][0] self._dynamic_config._backtrack_infos.setdefault(