summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilles Dartiguelongue <eva@gentoo.org>2015-06-27 00:08:58 +0200
committerGilles Dartiguelongue <eva@gentoo.org>2015-06-27 00:14:42 +0200
commit8590d8da1adf4445f928c940c2959d2a6035bdd8 (patch)
treea2074d50641e8ebedd5fa14bd3e403b75b1ca0eb
parentscripts/gen_archlist: drop unused imports (diff)
downloadgnome-8590d8da1adf4445f928c940c2959d2a6035bdd8.tar.gz
gnome-8590d8da1adf4445f928c940c2959d2a6035bdd8.tar.bz2
gnome-8590d8da1adf4445f928c940c2959d2a6035bdd8.zip
scripts/gen_archlist: cosmetics
-rwxr-xr-xscripts/gen_archlist.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/scripts/gen_archlist.py b/scripts/gen_archlist.py
index e4597c61..7c41a9ce 100755
--- a/scripts/gen_archlist.py
+++ b/scripts/gen_archlist.py
@@ -376,7 +376,11 @@ def consolidate_dupes(cpv_kws):
def get_per_slot_cpvs(cpvs):
- "Classify the given cpvs into slots, and yield the best atom for each slot"
+ """Return best CPV per slot.
+
+ Classify the CPVs into slots, and yield the best atom for each slot.
+ This only works with a pre-sorted list as returned by `match_wanted_atoms`.
+ """
slots = set()
for cpv in cpvs:
slot = portage.portage.portdb.aux_get(cpv, ['SLOT'])[0]
@@ -387,9 +391,9 @@ def get_per_slot_cpvs(cpvs):
def append_slots(cpv_kws):
- "Append slots at the end of cpv atoms"
+ """Append slots at the end of cpv atoms"""
slotifyed_cpv_kws = []
- for (cpv, kws) in cpv_kws:
+ for cpv, kws in cpv_kws:
slot = portage.portage.portdb.aux_get(cpv, ['SLOT'])[0]
cpv = "%s:%s" % (cpv, slot)
slotifyed_cpv_kws.append([cpv, kws])
@@ -489,11 +493,13 @@ def main():
continue
if cp.find('#') is not -1:
raise Exception('Inline comments are not supported')
+
+ # Convert line to CPV(s)
if portage.catpkgsplit(cp):
# cat/pkg is already a categ/pkg-ver
cpvs = [cp]
else:
- # Get all the atoms matching the given cp
+ # Get all the atoms matching the given CP
cpvs = match_wanted_atoms(cp, release=args.new_version)
for cpv in get_per_slot_cpvs(cpvs):