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 1QLLy2-0002fG-VC for garchives@archives.gentoo.org; Sat, 14 May 2011 21:01:43 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7E6901C044; Sat, 14 May 2011 21:01:32 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 391B01C044 for ; Sat, 14 May 2011 21:01:32 +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 A9C881B4062 for ; Sat, 14 May 2011 21:01:31 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id F0129459AA for ; Sat, 14 May 2011 21:01:30 +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: 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: a531c670849d81edd15ba3e3ae820cbfe063db68 Date: Sat, 14 May 2011 21:01:30 +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: 9e3aa6bf9d0bb72826ebf7a50e5797e4 commit: a531c670849d81edd15ba3e3ae820cbfe063db68 Author: Sebastian Luther gmx de> AuthorDate: Sat May 14 20:44:22 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Sat May 14 21:01:23 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Da531c670 --autounmask: Use >=3D atoms if possible If the package is the latest avaiable it now uses >=3Dcat/pkg-ver instead of =3Dcat/pkg-ver. If the package is not the latest, but the latest in its slot, >=3Dcat/pkg-ver:slot is used. In all other case =3Dcat/pkg-ver is used. Rational is that it's more likely that newer versions, added in the future, will work with the same configuration changes as the currently latest version than not. --- pym/_emerge/depgraph.py | 52 +++++++++++++++++++++++++++++++++++++++++= +++-- 1 files changed, 49 insertions(+), 3 deletions(-) diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 3169d19..16cb7fc 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -5543,10 +5543,38 @@ class depgraph(object): else: self._show_missed_update() =20 + def check_if_latest(pkg): + is_latest =3D True + is_latest_in_slot =3D True + dbs =3D self._dynamic_config._filtered_trees[pkg.root]["dbs"] + root_config =3D self._frozen_config.roots[pkg.root] + + all_cpv_by_slot =3D {} + for db, pkg_type, built, installed, db_keys in dbs: + for other_pkg in self._iter_match_pkgs(root_config, pkg_type, Atom(p= kg.cp)): + slot =3D other_pkg.metadata["SLOT"] + all_cpv_by_slot.setdefault(slot, set()) + all_cpv_by_slot[slot].add(other_pkg.cpv) + + all_cpv =3D [] + for cpvs in all_cpv_by_slot.values(): + all_cpv.extend(cpvs) + all_cpv.sort(key=3Dportage.versions.cpv_sort_key()) + + if all_cpv[-1] !=3D pkg.cpv: + is_latest =3D False + slot_cpvs =3D sorted(all_cpv_by_slot[pkg.metadata["SLOT"]], key=3Dpo= rtage.versions.cpv_sort_key()) + if slot_cpvs[-1] !=3D pkg.cpv: + is_latest_in_slot =3D False + + return is_latest, is_latest_in_slot + + unstable_keyword_msg =3D [] for pkg in self._dynamic_config._needed_unstable_keywords: self._show_merge_list() if pkg in self._dynamic_config.digraph: + is_latest, is_latest_in_slot =3D check_if_latest(pkg) pkgsettings =3D self._frozen_config.pkgsettings[pkg.root] mreasons =3D _get_masking_status(pkg, pkgsettings, pkg.root_config, use=3Dself._pkg_use_enabled(pkg)) @@ -5556,12 +5584,18 @@ class depgraph(object): keyword =3D reason.unmask_hint.value =20 unstable_keyword_msg.append(self._get_dep_chain_as_comment(pkg)) - unstable_keyword_msg.append("=3D%s %s\n" % (pkg.cpv, keyword)) + if is_latest: + unstable_keyword_msg.append(">=3D%s %s\n" % (pkg.cpv, keyword)) + elif is_latest_in_slot: + unstable_keyword_msg.append(">=3D%s:%s %s\n" % (pkg.cpv, pkg.meta= data["SLOT"], keyword)) + else: + unstable_keyword_msg.append("=3D%s %s\n" % (pkg.cpv, keyword)) =20 use_changes_msg =3D [] for pkg, needed_use_config_change in self._dynamic_config._needed_use_= config_changes.items(): self._show_merge_list() if pkg in self._dynamic_config.digraph: + is_latest, is_latest_in_slot =3D check_if_latest(pkg) changes =3D needed_use_config_change[1] adjustments =3D [] for flag, state in changes.items(): @@ -5570,14 +5604,26 @@ class depgraph(object): else: adjustments.append("-" + flag) use_changes_msg.append(self._get_dep_chain_as_comment(pkg, unsatisfi= ed_dependency=3DTrue)) - use_changes_msg.append("=3D%s %s\n" % (pkg.cpv, " ".join(adjustments= ))) + if is_latest: + use_changes_msg.append(">=3D%s %s\n" % (pkg.cpv, " ".join(adjustmen= ts))) + elif is_latest_in_slot: + use_changes_msg.append(">=3D%s:%s %s\n" % (pkg.cpv, pkg.metadata["S= LOT"], " ".join(adjustments))) + else: + use_changes_msg.append("=3D%s %s\n" % (pkg.cpv, " ".join(adjustment= s))) =20 license_msg =3D [] for pkg, missing_licenses in self._dynamic_config._needed_license_chan= ges.items(): self._show_merge_list() if pkg in self._dynamic_config.digraph: + is_latest, is_latest_in_slot =3D check_if_latest(pkg) + license_msg.append(self._get_dep_chain_as_comment(pkg)) - license_msg.append("=3D%s %s\n" % (pkg.cpv, " ".join(sorted(missing_= licenses)))) + if is_latest: + license_msg.append(">=3D%s %s\n" % (pkg.cpv, " ".join(sorted(missin= g_licenses)))) + elif is_latest_in_slot: + license_msg.append(">=3D%s:%s %s\n" % (pkg.cpv, pkg.metadata["SLOT"= ], " ".join(sorted(missing_licenses)))) + else: + license_msg.append("=3D%s %s\n" % (pkg.cpv, " ".join(sorted(missing= _licenses)))) =20 if unstable_keyword_msg: writemsg_stdout("\nThe following " + colorize("BAD", "keyword changes= ") + \