diff options
author | Gilles Dartiguelongue <eva@gentoo.org> | 2015-06-24 14:08:20 +0200 |
---|---|---|
committer | Gilles Dartiguelongue <eva@gentoo.org> | 2015-06-25 14:46:14 +0200 |
commit | 4542a3fc2042bb029e0a7b124724c6af41d6ff87 (patch) | |
tree | 2cc5f97d199fbd977e53c1536328b0866622050e /scripts | |
parent | scripts/gen_archlist: fix belongs_release (diff) | |
download | gnome-4542a3fc2042bb029e0a7b124724c6af41d6ff87.tar.gz gnome-4542a3fc2042bb029e0a7b124724c6af41d6ff87.tar.bz2 gnome-4542a3fc2042bb029e0a7b124724c6af41d6ff87.zip |
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.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/gen_archlist.py | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/scripts/gen_archlist.py b/scripts/gen_archlist.py index 9a74d21c..9b60f038 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 [ cpv for cpv in reversed(portage.portdb.xmatch('match-all', atom)) - if not do_not_want(cpv, release) + if can_stabilize_cpv(cpv, release) ] |