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:10
Message-Id: 1435236374.4542a3fc2042bb029e0a7b124724c6af41d6ff87.eva@gentoo
1 commit: 4542a3fc2042bb029e0a7b124724c6af41d6ff87
2 Author: Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jun 24 12:08:20 2015 +0000
4 Commit: Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
5 CommitDate: Thu Jun 25 12:46:14 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/gnome.git/commit/?id=4542a3fc
7
8 scripts/gen_archlist: rename do_not_want function
9
10 Give it a better name of split logic down in multiple lines, it is
11 easier to read that a kilometric if line.
12
13 Logic was inverted to avoid double negation in match_wanted_atoms
14 function.
15
16 scripts/gen_archlist.py | 24 +++++++++++++++---------
17 1 file changed, 15 insertions(+), 9 deletions(-)
18
19 diff --git a/scripts/gen_archlist.py b/scripts/gen_archlist.py
20 index 9a74d21..9b60f03 100755
21 --- a/scripts/gen_archlist.py
22 +++ b/scripts/gen_archlist.py
23 @@ -131,15 +131,21 @@ def get_kws(cpv, arches=ARCHES):
24 ]
25
26
27 -def do_not_want(cpv, release=None):
28 - """
29 - Check if a package atom is p.masked or has empty keywords, or does not
30 - belong to a release
31 +def can_stabilize_cpv(cpv, release=None):
32 + """Whether `cpv` matches stabilization criteria.
33 +
34 + `cpv` must:
35 + * belong to the release
36 + * not be p.masked
37 + * have keywords
38 """
39 - if release and not belongs_release(cpv, release) or not \
40 - portage.portdb.visible([cpv]) or not get_kws(cpv, arches=ALL_ARCHES):
41 - return True
42 - return False
43 + if release and not belongs_release(cpv, release):
44 + return False
45 + if not portage.portdb.visible([cpv]):
46 + return False
47 + if not get_kws(cpv, arches=ALL_ARCHES):
48 + return False
49 + return True
50
51
52 def match_wanted_atoms(atom, release=None):
53 @@ -155,7 +161,7 @@ def match_wanted_atoms(atom, release=None):
54
55 return [
56 cpv for cpv in reversed(portage.portdb.xmatch('match-all', atom))
57 - if not do_not_want(cpv, release)
58 + if can_stabilize_cpv(cpv, release)
59 ]