Gentoo Archives: gentoo-commits

From: Nirbheek Chauhan <nirbheek@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gnome:master commit in: scripts/
Date: Sun, 01 Apr 2012 19:12:53
Message-Id: 1333307549.47392a028ee246f124d03f4c25851111dff5e2d5.nirbheek@gentoo
1 commit: 47392a028ee246f124d03f4c25851111dff5e2d5
2 Author: Nirbheek Chauhan <nirbheek <AT> gentoo <DOT> org>
3 AuthorDate: Sun Apr 1 19:12:23 2012 +0000
4 Commit: Nirbheek Chauhan <nirbheek <AT> gentoo <DOT> org>
5 CommitDate: Sun Apr 1 19:12:29 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gnome.git;a=commit;h=47392a02
7
8 scripts/gen_archlist.py: add the ability to append slot info
9
10 * As requested by pacho
11
12 ---
13 scripts/gen_archlist.py | 15 +++++++++++++++
14 1 files changed, 15 insertions(+), 0 deletions(-)
15
16 diff --git a/scripts/gen_archlist.py b/scripts/gen_archlist.py
17 index ffef7eb..8f0e9a8 100755
18 --- a/scripts/gen_archlist.py
19 +++ b/scripts/gen_archlist.py
20 @@ -44,6 +44,7 @@ LINE_SEP = ''
21 DEBUG = False
22 EXTREME_DEBUG = False
23 CHECK_DEPS = False
24 +APPEND_SLOTS = False
25 # Check for stable keywords
26 STABLE = True
27
28 @@ -80,6 +81,9 @@ else:
29 if os.environ.has_key('CHECK_DEPS'):
30 CHECK_DEPS = os.environ['CHECK_DEPS']
31
32 +if os.environ.has_key('APPEND_SLOTS'):
33 + APPEND_SLOTS = os.environ['APPEND_SLOTS']
34 +
35 if not STABLE:
36 print 'Currently broken for anything except STABLEREQ'
37 print 'Please set STABLE to True'
38 @@ -384,6 +388,15 @@ def consolidate_dupes(cpv_kws):
39
40 return deduped_cpv_kws
41
42 +def append_slots(cpv_kws):
43 + "Append slots at the end of cpv atoms"
44 + slotifyed_cpv_kws = []
45 + for (cpv, kws) in cpv_kws:
46 + slot = portage.portage.portdb.aux_get(cpv, ['SLOT'])[0]
47 + cpv = "%s:%s" % (cpv, slot)
48 + slotifyed_cpv_kws.append([cpv, kws])
49 + return slotifyed_cpv_kws
50 +
51 # FIXME: This is broken
52 def prettify(cpv_kws):
53 "Takes a list of [cpv, [kws]] and prettifies it"
54 @@ -468,6 +481,8 @@ if __name__ == "__main__":
55 ALL_CPV_KWS.append(LINE_SEP)
56
57 ALL_CPV_KWS = consolidate_dupes(ALL_CPV_KWS)
58 + if APPEND_SLOTS:
59 + ALL_CPV_KWS = append_slots(ALL_CPV_KWS)
60
61 for i in prettify(ALL_CPV_KWS):
62 print i[0], flatten(i[1])