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 1Q4F6C-0002Xd-Gs for garchives@archives.gentoo.org; Mon, 28 Mar 2011 16:15:25 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C5C7A1C077; Mon, 28 Mar 2011 16:15:15 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 9759A1C077 for ; Mon, 28 Mar 2011 16:15:15 +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 2E50A1B4031 for ; Mon, 28 Mar 2011 16:15:15 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 87D3F8006A for ; Mon, 28 Mar 2011 16:15:14 +0000 (UTC) From: "Nirbheek Chauhan" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Nirbheek Chauhan" Message-ID: Subject: [gentoo-commits] proj/gnome:master commit in: scripts/ X-VCS-Repository: proj/gnome X-VCS-Files: scripts/slot_rindex.py X-VCS-Directories: scripts/ X-VCS-Committer: nirbheek X-VCS-Committer-Name: Nirbheek Chauhan X-VCS-Revision: c35f4ec82c12d0f13c78b97ce9ba53907a520a0a Date: Mon, 28 Mar 2011 16:15:14 +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: 528fcb81659947ba644b2b627ed4b76b commit: c35f4ec82c12d0f13c78b97ce9ba53907a520a0a Author: Nirbheek Chauhan gentoo org> AuthorDate: Mon Mar 28 16:14:39 2011 +0000 Commit: Nirbheek Chauhan gentoo org> CommitDate: Mon Mar 28 16:14:41 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gnome.git;a=3D= commit;h=3Dc35f4ec8 slot_rindex.py: take care of =3Dcat/pkg-ver* deps Earlier, categorization was done purely on the basis of the :slot dep. Now, =3Dcat/pkg-ver* deps are also taken into account while generating th= e slot-rdep mapping --- scripts/slot_rindex.py | 27 ++++++++++++++++++++++++--- 1 files changed, 24 insertions(+), 3 deletions(-) diff --git a/scripts/slot_rindex.py b/scripts/slot_rindex.py index 3ca50dc..f66b599 100755 --- a/scripts/slot_rindex.py +++ b/scripts/slot_rindex.py @@ -122,6 +122,27 @@ def get_deps_both(cpv, depvars=3DDEPVARS): dep_cps.add(portage.dep.dep_getkey(dep)) return (dep_cps, dep_strs) =20 +def get_dep_slot(dep): + """ + If the dep atom contains a slot, return that + If the dep atom doesn't contain a slot, but is of the =3Dcat/pkg-ver= * type, + check which slots each satisfied cpv has, and return that if they're= all the + same; return None if they're different + """ + # FIXME: Use our own portdb so that we match atoms outside of PORTDI= R too + slot =3D portage.dep.dep_getslot(dep) + if slot or not dep.startswith('=3D'): + return slot + cp =3D portage.dep.dep_getkey(dep) + cpvrs =3D portage.dep.match_from_list(dep, portdb.xmatch('match-all'= , cp)) + for cpvr in cpvrs: + my_slot =3D portdb.aux_get(cpvr, ['SLOT'])[0] + if slot and my_slot !=3D slot: + # omg, one of the slots is different + return None + slot =3D my_slot + return slot + def get_revdeps_rindex(key): """ Given a key, returns a reverse-dependency list of that key using the= tinderbox rindex @@ -172,10 +193,10 @@ for rdep in revdeps: (cps, deps) =3D get_deps_both(rdep) if KEY not in cps: continue - for cpv in deps: - if cpv.find(KEY) =3D=3D -1: + for dep in deps: + if dep.find(KEY) =3D=3D -1: continue - slot =3D portage.dep.dep_getslot(cpv) + slot =3D get_dep_slot(dep) if not slot_rdeps.has_key(slot): slot_rdeps[slot] =3D [] slot_rdeps[slot].append(rdep)