From: "Nirbheek Chauhan" <nirbheek@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gnome:master commit in: scripts/
Date: Mon, 14 Mar 2011 18:41:05 +0000 (UTC) [thread overview]
Message-ID: <05728bccfe889008593f9c5a5f599b0459ce0863.nirbheek@gentoo> (raw)
commit: 05728bccfe889008593f9c5a5f599b0459ce0863
Author: Nirbheek Chauhan <nirbheek <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 14 17:32:39 2011 +0000
Commit: Nirbheek Chauhan <nirbheek <AT> gentoo <DOT> org>
CommitDate: Mon Mar 14 17:32:39 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gnome.git;a=commit;h=05728bcc
obsolete_ebuilds.py: find obsolete ebuilds considering each SLOT separately
---
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 = get_cpv(cp_all[0])
eoutput.eend(0)
-for cp in portdb.cp_all(categories=[GSTCAT]):
+for cp in cp_all:
cpv = 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 = portdb.xmatch('match-all', cp)
- # Hashtable of unique {kws: cpv} pairs
- all_kws = set()
+ cpvs = portdb.xmatch('match-all', cp)
obsolete_cpvs = []
not_pmasked = []
+ slot_cpvs = {}
+
# 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 = {'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 ebuilds as obsolete
not_pmasked.reverse()
+
+ # Generate a slot-sorted hashtable for cpvs
for cpv in not_pmasked:
- kws = set(get_kws(cpv, arches=ALL_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) => can be punted
- obsolete_cpvs.append(cpv)
+ slot = portdb.aux_get(cpv, ['SLOT'])[0]
+ if not slot_cpvs.has_key(slot):
+ slot_cpvs[slot] = []
+ slot_cpvs[slot].append(cpv)
+
+ # Consider each slot separately for obsolete-detection
+ for (slot, cpvs) in slot_cpvs.iteritems():
+ all_kws = set()
+ for cpv in cpvs:
+ kws = set(get_kws(cpv, arches=ALL_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) => can be punted
+ obsolete_cpvs.append(cpv)
return obsolete_cpvs
if __name__ == "__main__":
next reply other threads:[~2011-03-14 18:41 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-14 18:41 Nirbheek Chauhan [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-04-03 19:42 [gentoo-commits] proj/gnome:master commit in: scripts/ Matt Turner
2020-04-03 19:42 Matt Turner
2020-03-28 8:31 Mart Raudsepp
2020-03-10 22:05 Matt Turner
2019-02-07 11:58 Mart Raudsepp
2018-04-25 10:32 Mart Raudsepp
2018-01-10 3:25 Mart Raudsepp
2012-04-01 21:14 Nirbheek Chauhan
2012-04-01 19:12 Nirbheek Chauhan
2011-08-18 6:23 Nirbheek Chauhan
2011-07-12 21:15 Nirbheek Chauhan
2011-05-21 18:38 Nirbheek Chauhan
2011-05-19 12:35 Gilles Dartiguelongue
2011-04-13 9:57 Nirbheek Chauhan
2011-04-09 6:29 Nirbheek Chauhan
2011-03-28 16:15 Nirbheek Chauhan
2011-03-28 15:04 Nirbheek Chauhan
2011-03-26 1:58 Nirbheek Chauhan
2011-03-23 21:59 Nirbheek Chauhan
2011-03-23 21:59 Nirbheek Chauhan
2011-03-23 21:59 Nirbheek Chauhan
2011-03-23 19:21 Gilles Dartiguelongue
2011-03-23 10:39 Gilles Dartiguelongue
2011-03-20 8:11 Nirbheek Chauhan
2011-03-18 9:59 Nirbheek Chauhan
2011-03-18 8:23 Nirbheek Chauhan
2011-03-17 17:12 Nirbheek Chauhan
2011-03-15 13:08 Nirbheek Chauhan
2011-03-12 20:10 Nirbheek Chauhan
2011-03-04 15:40 Nirbheek Chauhan
2011-02-18 4:40 Nirbheek Chauhan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=05728bccfe889008593f9c5a5f599b0459ce0863.nirbheek@gentoo \
--to=nirbheek@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox