public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Nirbheek Chauhan" <nirbheek@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gnome:master commit in: scripts/
Date: Sat, 26 Mar 2011 01:58:36 +0000 (UTC)	[thread overview]
Message-ID: <b243ed092dcdc3658ed75b9e1f0d73e7945e3031.nirbheek@gentoo> (raw)

commit:     b243ed092dcdc3658ed75b9e1f0d73e7945e3031
Author:     Nirbheek Chauhan <nirbheek <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 26 01:40:29 2011 +0000
Commit:     Nirbheek Chauhan <nirbheek <AT> gentoo <DOT> org>
CommitDate: Sat Mar 26 01:52:13 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gnome.git;a=commit;h=b243ed09

slot_rindex.py: use os.environ to toggle PORTAGE_ONLY

---
 scripts/slot_rindex.py |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/scripts/slot_rindex.py b/scripts/slot_rindex.py
index 3610813..c77817f 100755
--- a/scripts/slot_rindex.py
+++ b/scripts/slot_rindex.py
@@ -13,6 +13,7 @@
 #
 
 import sys
+import os
 import os.path as osp
 
 import portage
@@ -32,6 +33,8 @@ if len(sys.argv) < 2:
 
 KEY = sys.argv[1]
 PORTAGE_ONLY = False
+if os.environ.has_key('PORTAGE_ONLY'):
+    PORTAGE_ONLY = os.environ['PORTAGE_ONLY']
 
 ########################
 ### Output Functions ###
@@ -119,27 +122,33 @@ def get_deps_both(cpv, depvars=DEPVARS):
 def get_revdeps_rindex(key):
     """
     Given a key, returns a reverse-dependency list of that key using the tinderbox rindex
+    list will be a sorted list of unique cpvs
     """
     import urllib2
     RINDEX = "http://tinderbox.dev.gentoo.org/misc/rindex"
-    revdeps = []
+    revdeps = set()
     rdeps_raw = urllib2.urlopen('/'.join([RINDEX, key])).read().split()
     for i in rdeps_raw:
         cpv = i.split(':')[0]
         if portage.isvalidatom('='+cpv):
-            revdeps.append(cpv)
+            revdeps.add(cpv)
+    revdeps = list(revdeps)
+    revdeps.sort()
     return revdeps
 
 def get_revdeps_portage(key):
     """
     Given a key, returns a reverse-dependency list of that key using portage API
+    list will be a sorted list of unique cpvs
     """
-    revdeps = []
+    revdeps = set()
     for cp in portdb.cp_all():
         cpvrs = portdb.xmatch('match-all', cp)
         for cpvr in cpvrs:
             if key in get_deps_both(cpvr)[0]:
-                revdeps.append(cpvr)
+                revdeps.add(cpvr)
+    revdeps = list(revdeps)
+    revdeps.sort()
     return revdeps
 
 ###################



             reply	other threads:[~2011-03-26  1:58 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-26  1:58 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-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-14 18:41 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=b243ed092dcdc3658ed75b9e1f0d73e7945e3031.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