commit: 06183b984bf5b65d00f3a48fc825019fdc40a524
Author: Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 24 12:08:20 2015 +0000
Commit: Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
CommitDate: Wed Jun 24 12:13:28 2015 +0000
URL: https://gitweb.gentoo.org/proj/gnome.git/commit/?id=06183b98
scripts/gen_archlist: Rename do_not_want function
Give it a better name of split logic down in multiple lines, it is
easier to read that a kilometric if line.
Logic was inverted to avoid double negation in match_wanted_atoms
function.
scripts/gen_archlist.py | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/scripts/gen_archlist.py b/scripts/gen_archlist.py
index a517ed8..a8b5fcf 100755
--- a/scripts/gen_archlist.py
+++ b/scripts/gen_archlist.py
@@ -131,15 +131,21 @@ def get_kws(cpv, arches=ARCHES):
]
-def do_not_want(cpv, release=None):
- """
- Check if a package atom is p.masked or has empty keywords, or does not
- belong to a release
+def can_stabilize_cpv(cpv, release=None):
+ """Whether `cpv` matches stabilization criteria.
+
+ `cpv` must:
+ * belong to the release
+ * not be p.masked
+ * have keywords
"""
- if release and not belongs_release(cpv, release) or not \
- portage.portdb.visible([cpv]) or not get_kws(cpv, arches=ALL_ARCHES):
- return True
- return False
+ if release and not belongs_release(cpv, release):
+ return False
+ if not portage.portdb.visible([cpv]):
+ return False
+ if not get_kws(cpv, arches=ALL_ARCHES):
+ return False
+ return True
def match_wanted_atoms(atom, release=None):
@@ -155,7 +161,7 @@ def match_wanted_atoms(atom, release=None):
return [
for cpv in reversed(portage.portdb.xmatch('match-all', atom)):
- if not do_not_want(cpv, release)
+ if can_stabilize_cpv(cpv, release)
]