public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Gilles Dartiguelongue" <eva@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gnome:gen_archlist_cleanup commit in: scripts/
Date: Fri, 26 Jun 2015 22:32:03 +0000 (UTC)	[thread overview]
Message-ID: <1435236374.4542a3fc2042bb029e0a7b124724c6af41d6ff87.eva@gentoo> (raw)

commit:     4542a3fc2042bb029e0a7b124724c6af41d6ff87
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: Thu Jun 25 12:46:14 2015 +0000
URL:        https://gitweb.gentoo.org/proj/gnome.git/commit/?id=4542a3fc

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 9a74d21..9b60f03 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)
     ]
 
 


             reply	other threads:[~2015-06-26 22:32 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-26 22:32 Gilles Dartiguelongue [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-09-06 16:53 [gentoo-commits] proj/gnome:gen_archlist_cleanup commit in: scripts/ Gilles Dartiguelongue
2015-06-26 22:32 Gilles Dartiguelongue
2015-06-26 22:32 Gilles Dartiguelongue
2015-06-26 22:32 Gilles Dartiguelongue
2015-06-26 22:32 Gilles Dartiguelongue
2015-06-26 22:32 Gilles Dartiguelongue
2015-06-26 22:32 Gilles Dartiguelongue
2015-06-26 22:32 Gilles Dartiguelongue
2015-06-26 22:32 Gilles Dartiguelongue
2015-06-26 22:32 Gilles Dartiguelongue
2015-06-26 22:32 Gilles Dartiguelongue
2015-06-26 22:32 Gilles Dartiguelongue
2015-06-26 22:32 Gilles Dartiguelongue
2015-06-26 22:32 Gilles Dartiguelongue
2015-06-26 22:32 Gilles Dartiguelongue
2015-06-26 22:32 Gilles Dartiguelongue
2015-06-26 22:32 Gilles Dartiguelongue
2015-06-26 22:32 Gilles Dartiguelongue
2015-06-26 22:32 Gilles Dartiguelongue
2015-06-26 22:32 Gilles Dartiguelongue
2015-06-26 22:32 Gilles Dartiguelongue
2015-06-24 12:14 Gilles Dartiguelongue
2015-06-24 12:14 Gilles Dartiguelongue
2015-06-24 12:14 Gilles Dartiguelongue
2015-06-24 12:14 Gilles Dartiguelongue
2015-06-24 12:14 Gilles Dartiguelongue
2015-06-24 12:14 Gilles Dartiguelongue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1435236374.4542a3fc2042bb029e0a7b124724c6af41d6ff87.eva@gentoo \
    --to=eva@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox