public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Brian Dolbec" <brian.dolbec@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/revdep_rebuild/
Date: Wed, 19 Feb 2014 03:14:39 +0000 (UTC)	[thread overview]
Message-ID: <1392777020.b053a6e175467e0d28854e8ec6f008e3dbaf811c.dol-sen@gentoo> (raw)

commit:     b053a6e175467e0d28854e8ec6f008e3dbaf811c
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 19 02:30:20 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Wed Feb 19 02:30:20 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=b053a6e1

revdep_rebuild: Fix pkgs to merge being incorrectly filtered.

Move masked package filtering to a function.
Relocate the masking check to rebuild() only for exact version rebuilds.
Filtering was already done in get_slotted_cps().

---
 pym/gentoolkit/revdep_rebuild/rebuild.py | 26 ++++++--------------------
 pym/gentoolkit/revdep_rebuild/stuff.py   | 26 ++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 20 deletions(-)

diff --git a/pym/gentoolkit/revdep_rebuild/rebuild.py b/pym/gentoolkit/revdep_rebuild/rebuild.py
index 3e91058..ea0c25a 100644
--- a/pym/gentoolkit/revdep_rebuild/rebuild.py
+++ b/pym/gentoolkit/revdep_rebuild/rebuild.py
@@ -20,13 +20,13 @@ import os
 import sys
 import getopt
 import logging
-from portage.output import bold, red, blue, yellow, green, nocolor
+from portage.output import bold, red, blue, yellow, nocolor
 
 from .analyse import analyse
-from .stuff import get_masking_status
 from .cache import check_temp_files, read_cache
 from .assign import get_slotted_cps
 from .settings import DEFAULTS
+from .stuff import filter_masked
 from . import __version__
 
 
@@ -143,9 +143,11 @@ def rebuild(logger, assigned, settings):
 
 	args = settings['pass_through_options']
 	if settings['EXACT']:
-		emerge_command = '=' + ' ='.join(assigned)
+		_assigned = filter_masked(assigned, logger)
+		emerge_command = '=' + ' ='.join(_assigned)
 	else:
-		emerge_command = ' '.join(get_slotted_cps(assigned, logger))
+		_assigned = get_slotted_cps(assigned, logger)
+		emerge_command = ' '.join(_assigned)
 	if settings['PRETEND']:
 		args += ' --pretend'
 	if settings['VERBOSITY'] >= 2:
@@ -253,22 +255,6 @@ def main(settings=None, logger=None):
 		for filename in orphaned:
 			logger.warn(red('\t* ') + filename)
 
-	has_masked = False
-	tmp = []
-	for ebuild in assigned:
-		if get_masking_status(ebuild):
-			has_masked = True
-			logger.warn(' !!! ' + red('All ebuilds that could satisfy: ') +
-				green(ebuild) + red(' have been masked'))
-		else:
-			tmp.append(ebuild)
-	assigned = tmp
-
-	if has_masked:
-		logger.info('\t' + red('* ') +
-			'Unmask all ebuild(s) listed above and call revdep-rebuild '
-			'again or manually emerge given packages.')
-
 	success = rebuild(logger, assigned, settings)
 	logger.debug("rebuild return code = %i" %success)
 	return success

diff --git a/pym/gentoolkit/revdep_rebuild/stuff.py b/pym/gentoolkit/revdep_rebuild/stuff.py
index e0fc7b5..cc3da7b 100644
--- a/pym/gentoolkit/revdep_rebuild/stuff.py
+++ b/pym/gentoolkit/revdep_rebuild/stuff.py
@@ -8,6 +8,7 @@ from __future__ import print_function
 import subprocess
 
 import portage
+from portage.output import green, red
 
 
 # util. functions
@@ -75,6 +76,31 @@ def _match_str_in_list(lst, stri):
 	return False
 
 
+def filter_masked(assigned, logger):
+	'''Filter out masked pkgs/ebuilds'''
+
+	def is_masked(ebuild):
+		if get_masking_status(ebuild):
+			logger.warn(' !!! ' + red('All ebuilds that could satisfy: ') +
+				green(ebuild) + red(' have been masked'))
+			return True
+		return False
+
+	has_masked = False
+	tmp = []
+	for ebuild in assigned:
+		if not is_masked(ebuild):
+			tmp.append(ebuild)
+		else:
+			has_masked = True
+	if has_masked:
+		logger.info('\t' + red('* ') +
+			'Unmask all ebuild(s) listed above and call revdep-rebuild '
+			'again or manually emerge given packages.')
+	return tmp
+
+
+
 
 if __name__ == '__main__':
 	print("There is nothing to run here.")


             reply	other threads:[~2014-02-19  3:14 UTC|newest]

Thread overview: 115+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-19  3:14 Brian Dolbec [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-05-27 17:27 [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/revdep_rebuild/ Mike Gilbert
2014-11-12 21:29 Paul Varner
2014-11-12  7:16 Slawek Lis
2014-11-07 20:41 Slawek Lis
2014-11-07 20:41 Slawek Lis
2014-11-07 20:41 Slawek Lis
2014-11-07 20:41 Slawek Lis
2014-11-07 20:41 Slawek Lis
2014-11-07 20:41 Slawek Lis
2014-10-30 18:56 Paul Varner
2014-08-28  7:37 Slawek Lis
2014-03-27  6:59 Slawek Lis
2014-03-26  8:21 Slawek Lis
2014-03-24  7:17 Slawek Lis
2014-03-24  7:17 Slawek Lis
2014-03-17  6:50 Slawek Lis
2014-03-17  6:50 Slawek Lis
2014-03-11 21:43 Paul Varner
2014-03-11 21:22 Paul Varner
2014-02-19  5:01 Brian Dolbec
2014-02-19  4:33 Brian Dolbec
2014-02-19  4:33 Brian Dolbec
2014-02-19  3:14 Brian Dolbec
2014-02-19  3:14 Brian Dolbec
2014-02-19  3:14 Brian Dolbec
2014-02-19  3:14 Brian Dolbec
2014-02-19  3:14 Brian Dolbec
2014-02-19  3:14 Brian Dolbec
2014-02-19  3:14 Brian Dolbec
2014-02-18 18:51 Brian Dolbec
2014-02-18 18:51 Brian Dolbec
2014-02-18 17:59 Brian Dolbec
2014-02-18 17:23 Brian Dolbec
2014-02-18  7:30 Brian Dolbec
2014-02-18  6:15 Brian Dolbec
2014-02-17 10:31 Slawek Lis
2014-02-17  8:50 Slawek Lis
2014-02-16 20:55 Brian Dolbec
2014-02-13 22:08 Paul Varner
2014-02-12 21:12 Paul Varner
2014-02-12 16:20 Brian Dolbec
2014-02-12 16:20 Brian Dolbec
2014-02-12 10:42 Brian Dolbec
2014-02-12 10:22 Brian Dolbec
2014-02-12 10:22 Brian Dolbec
2014-02-12 10:22 Brian Dolbec
2014-02-12 10:22 Brian Dolbec
2014-02-11 19:39 Brian Dolbec
2014-02-11 18:49 Brian Dolbec
2014-02-11 18:49 Brian Dolbec
2014-02-11 18:49 Brian Dolbec
2014-02-11 18:49 Brian Dolbec
2014-02-11 18:49 Brian Dolbec
2014-02-11 18:49 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2012-11-09 14:16 Paul Varner
2012-03-19  6:50 Brian Dolbec
2012-03-04  7:41 Brian Dolbec
2012-03-02 17:47 Brian Dolbec
2011-10-10 17:36 Brian Dolbec
2011-10-10 16:09 Brian Dolbec
2011-07-14 18:29 Paul Varner
2011-07-14 18:29 Paul Varner
2011-07-14  2:32 Paul Varner
2011-07-14  1:44 Brian Dolbec
2011-07-14  1:44 Brian Dolbec
2011-07-13 20:06 Paul Varner
2011-07-13 16:01 Paul Varner
2011-07-13 15:35 Brian Dolbec
2011-07-13  5:53 Brian Dolbec
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner

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=1392777020.b053a6e175467e0d28854e8ec6f008e3dbaf811c.dol-sen@gentoo \
    --to=brian.dolbec@gmail.com \
    --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