Gentoo Archives: gentoo-commits

From: Gilles Dartiguelongue <eva@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gnome:gen_archlist_cleanup commit in: scripts/
Date: Fri, 26 Jun 2015 22:32:19
Message-Id: 1435356882.8590d8da1adf4445f928c940c2959d2a6035bdd8.eva@gentoo
1 commit: 8590d8da1adf4445f928c940c2959d2a6035bdd8
2 Author: Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jun 26 22:08:58 2015 +0000
4 Commit: Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
5 CommitDate: Fri Jun 26 22:14:42 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/gnome.git/commit/?id=8590d8da
7
8 scripts/gen_archlist: cosmetics
9
10 scripts/gen_archlist.py | 14 ++++++++++----
11 1 file changed, 10 insertions(+), 4 deletions(-)
12
13 diff --git a/scripts/gen_archlist.py b/scripts/gen_archlist.py
14 index e4597c6..7c41a9c 100755
15 --- a/scripts/gen_archlist.py
16 +++ b/scripts/gen_archlist.py
17 @@ -376,7 +376,11 @@ def consolidate_dupes(cpv_kws):
18
19
20 def get_per_slot_cpvs(cpvs):
21 - "Classify the given cpvs into slots, and yield the best atom for each slot"
22 + """Return best CPV per slot.
23 +
24 + Classify the CPVs into slots, and yield the best atom for each slot.
25 + This only works with a pre-sorted list as returned by `match_wanted_atoms`.
26 + """
27 slots = set()
28 for cpv in cpvs:
29 slot = portage.portage.portdb.aux_get(cpv, ['SLOT'])[0]
30 @@ -387,9 +391,9 @@ def get_per_slot_cpvs(cpvs):
31
32
33 def append_slots(cpv_kws):
34 - "Append slots at the end of cpv atoms"
35 + """Append slots at the end of cpv atoms"""
36 slotifyed_cpv_kws = []
37 - for (cpv, kws) in cpv_kws:
38 + for cpv, kws in cpv_kws:
39 slot = portage.portage.portdb.aux_get(cpv, ['SLOT'])[0]
40 cpv = "%s:%s" % (cpv, slot)
41 slotifyed_cpv_kws.append([cpv, kws])
42 @@ -489,11 +493,13 @@ def main():
43 continue
44 if cp.find('#') is not -1:
45 raise Exception('Inline comments are not supported')
46 +
47 + # Convert line to CPV(s)
48 if portage.catpkgsplit(cp):
49 # cat/pkg is already a categ/pkg-ver
50 cpvs = [cp]
51 else:
52 - # Get all the atoms matching the given cp
53 + # Get all the atoms matching the given CP
54 cpvs = match_wanted_atoms(cp, release=args.new_version)
55
56 for cpv in get_per_slot_cpvs(cpvs):