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 1PzChe-0000FI-It for garchives@archives.gentoo.org; Mon, 14 Mar 2011 18:41:18 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 265F11C00C; Mon, 14 Mar 2011 18:41:07 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id D21841C00C for ; Mon, 14 Mar 2011 18:41:06 +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 52D071B40C2 for ; Mon, 14 Mar 2011 18:41:06 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 533C38006A for ; Mon, 14 Mar 2011 18:41:05 +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: <05728bccfe889008593f9c5a5f599b0459ce0863.nirbheek@gentoo> Subject: [gentoo-commits] proj/gnome:master commit in: scripts/ X-VCS-Repository: proj/gnome X-VCS-Files: scripts/gst-plugins-bump.py scripts/obsolete_ebuilds.py X-VCS-Directories: scripts/ X-VCS-Committer: nirbheek X-VCS-Committer-Name: Nirbheek Chauhan X-VCS-Revision: 05728bccfe889008593f9c5a5f599b0459ce0863 Date: Mon, 14 Mar 2011 18:41:05 +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: fc40502a341957ce6b3ed51b80f3d6d0 commit: 05728bccfe889008593f9c5a5f599b0459ce0863 Author: Nirbheek Chauhan gentoo org> AuthorDate: Mon Mar 14 17:32:39 2011 +0000 Commit: Nirbheek Chauhan gentoo org> CommitDate: Mon Mar 14 17:32:39 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gnome.git;a=3D= commit;h=3D05728bcc obsolete_ebuilds.py: find obsolete ebuilds considering each SLOT separate= ly --- scripts/gst-plugins-bump.py | 2 +- scripts/obsolete_ebuilds.py | 37 ++++++++++++++++++++++++------------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/scripts/gst-plugins-bump.py b/scripts/gst-plugins-bump.py index 4e2e490..1d6e5c1 100755 --- a/scripts/gst-plugins-bump.py +++ b/scripts/gst-plugins-bump.py @@ -138,7 +138,7 @@ eoutput.ebegin("Getting the next gst-plugin") # Does a first-time-expensive xmatch call cpv =3D get_cpv(cp_all[0]) eoutput.eend(0) -for cp in portdb.cp_all(categories=3D[GSTCAT]): +for cp in cp_all: cpv =3D get_cpv(cp) if not isgstplugin(cpv): continue diff --git a/scripts/obsolete_ebuilds.py b/scripts/obsolete_ebuilds.py index d4cb6b5..23af29c 100755 --- a/scripts/obsolete_ebuilds.py +++ b/scripts/obsolete_ebuilds.py @@ -80,14 +80,14 @@ def get_obsolete(cp): @param check_kws: Which keywords to check for obsolete ebuilds, both= /stable/unstable @type check_kws: String """ - all_cpvs =3D portdb.xmatch('match-all', cp) - # Hashtable of unique {kws: cpv} pairs - all_kws =3D set() + cpvs =3D portdb.xmatch('match-all', cp) obsolete_cpvs =3D [] not_pmasked =3D [] + slot_cpvs =3D {} + # This is copied from portage/dbapi/porttree.py:visible() - # Ignore PORTDIR package.mask cpv - for cpv in all_cpvs: + # Ignore PORTDIR package.masked cpvs + for cpv in cpvs: try: metadata =3D {'SLOT': portdb.aux_get(cpv, ['SLOT'])} except KeyError: @@ -97,16 +97,27 @@ def get_obsolete(cp): continue # We skip the profile check because we don't care about that not_pmasked.append(cpv) - # We want the latest cpvs first so that we never mark newer ebuilds = as obsolete + # We start with the latest cpvs first so that we never mark newer eb= uilds as obsolete not_pmasked.reverse() + =20 + # Generate a slot-sorted hashtable for cpvs for cpv in not_pmasked: - kws =3D set(get_kws(cpv, arches=3DALL_ARCHES)) - if cmp_kws(kws, all_kws): - # Keywords list is unique or better, so add it to the list - all_kws.update(kws) - else: - # Same or worse keywords (unstable and stable) =3D> can be p= unted - obsolete_cpvs.append(cpv) + slot =3D portdb.aux_get(cpv, ['SLOT'])[0] + if not slot_cpvs.has_key(slot): + slot_cpvs[slot] =3D [] + slot_cpvs[slot].append(cpv) + + # Consider each slot separately for obsolete-detection + for (slot, cpvs) in slot_cpvs.iteritems(): + all_kws =3D set() + for cpv in cpvs: + kws =3D set(get_kws(cpv, arches=3DALL_ARCHES)) + if cmp_kws(kws, all_kws): + # Keywords list is unique or better, so add it to the li= st + all_kws.update(kws) + else: + # Same or worse keywords (unstable and stable) =3D> can = be punted + obsolete_cpvs.append(cpv) return obsolete_cpvs =20 if __name__ =3D=3D "__main__":