From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 82800198005 for ; Wed, 13 Mar 2013 05:10:29 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 35571E051E; Wed, 13 Mar 2013 05:10:28 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A5C64E051E for ; Wed, 13 Mar 2013 05:10:27 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8FA8733DA96 for ; Wed, 13 Mar 2013 05:10:26 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 1D2A9E4079 for ; Wed, 13 Mar 2013 05:10:25 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1363151408.16e1f2185bb7ed36d3119b29a50ca0ff75fa8b71.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/actions.py pym/_emerge/depgraph.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 16e1f2185bb7ed36d3119b29a50ca0ff75fa8b71 X-VCS-Branch: master Date: Wed, 13 Mar 2013 05:10:25 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 07794d1c-8b09-4b99-bfca-47923b53aefb X-Archives-Hash: ef76772ec03443e62269800064793d83 commit: 16e1f2185bb7ed36d3119b29a50ca0ff75fa8b71 Author: Zac Medico gentoo org> AuthorDate: Wed Mar 13 05:10:08 2013 +0000 Commit: Zac Medico gentoo org> CommitDate: Wed Mar 13 05:10:08 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=16e1f218 expand_set_arguments: defer set load for depgraph This allows the depgraph to display the "Calculating dependencies" message before sets are loaded, as discussed in bug #461412. --- pym/_emerge/actions.py | 12 +++++++++--- pym/_emerge/depgraph.py | 28 ++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index 7fe8e83..d7d248a 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -3340,7 +3340,7 @@ def expand_set_arguments(myfiles, myaction, root_config): # world file, the depgraph performs set expansion later. It will get # confused about where the atoms came from if it's not allowed to # expand them itself. - do_not_expand = (None, ) + do_not_expand = myaction is None newargs = [] for a in myfiles: if a in ("system", "world"): @@ -3406,6 +3406,14 @@ def expand_set_arguments(myfiles, myaction, root_config): for line in textwrap.wrap(msg, 50): out.ewarn(line) setconfig.active.append(s) + + if do_not_expand: + # Loading sets can be slow, so skip it here, in order + # to allow the depgraph to indicate progress with the + # spinner while sets are loading (bug #461412). + newargs.append(a) + continue + try: set_atoms = setconfig.getSetAtoms(s) except portage.exception.PackageSetNotFound as e: @@ -3426,8 +3434,6 @@ def expand_set_arguments(myfiles, myaction, root_config): retval = 1 elif not set_atoms: print("emerge: '%s' is an empty set" % s) - elif myaction not in do_not_expand: - newargs.extend(set_atoms) else: newargs.append(SETPREFIX+s) for e in sets[s].errors: diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 965d3bc..7e3a0eb 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -2714,6 +2714,29 @@ class depgraph(object): raise portage.exception.PackageSetNotFound(s) if s in depgraph_sets.sets: continue + + try: + set_atoms = root_config.setconfig.getSetAtoms(s) + except portage.exception.PackageSetNotFound as e: + writemsg_level("\n\n", level=logging.ERROR, + noiselevel=-1) + for pset in list(depgraph_sets.sets.values()) + [sets[s]]: + for error_msg in pset.errors: + sys.stderr.write("%s\n" % (error_msg,)) + + writemsg_level(("emerge: the given set '%s' " + "contains a non-existent set named '%s'.\n") % \ + (s, e), level=logging.ERROR, noiselevel=-1) + if s in ('world', 'selected') and \ + SETPREFIX + e.value in sets['selected']: + writemsg_level(("Use `emerge --deselect %s%s` to " + "remove this set from world_sets.\n") % + (SETPREFIX, e,), level=logging.ERROR, + noiselevel=-1) + writemsg_level("\n", level=logging.ERROR, + noiselevel=-1) + return False, myfavorites + pset = sets[s] depgraph_sets.sets[s] = pset args.append(SetArg(arg=x, pset=pset, @@ -7031,6 +7054,11 @@ class depgraph(object): self._display_autounmask() + for depgraph_sets in self._dynamic_config.sets.values(): + for pset in depgraph_sets.sets.values(): + for e in pset.errors: + sys.stderr.write("%s\n" % (e,)) + # TODO: Add generic support for "set problem" handlers so that # the below warnings aren't special cases for world only.