commit:     8590d8da1adf4445f928c940c2959d2a6035bdd8
Author:     Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 26 22:08:58 2015 +0000
Commit:     Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
CommitDate: Fri Jun 26 22:14:42 2015 +0000
URL:        https://gitweb.gentoo.org/proj/gnome.git/commit/?id=8590d8da

scripts/gen_archlist: cosmetics

 scripts/gen_archlist.py | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/scripts/gen_archlist.py b/scripts/gen_archlist.py
index e4597c6..7c41a9c 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):

Reply via email to