Gentoo Archives: gentoo-portage-dev

From: Brian Dolbec <dolsen@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] depgraph: Skip atoms that are None (bug 505944)
Date: Thu, 27 Mar 2014 16:16:30
Message-Id: 20140327091608.46339c1d.dolsen@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH] depgraph: Skip atoms that are None (bug 505944) by Alexander Berntsen
1 On Thu, 27 Mar 2014 13:21:03 +0100
2 Alexander Berntsen <bernalex@g.o> wrote:
3
4 > Don't try to display atoms that are None when in debug mode.
5 > ---
6 > Can I get an ACK on this please? Do share your ideas for refactoring,
7 > if any. But even if this is not how we want it to work in the end, I
8 > still think we should commit it to fix the bug.
9 >
10 >
11
12 This is not nearly bad enough a bug to commit a panic fix.
13 It is the result of a typo on the commandline only.
14
15 I did some testing on my system. This bug depends on there being a
16 resume list. During testing, I tried dropping the -p option in a root
17 terminal, with a different change applied to prevent the traceback.
18
19 It output a huge long list of debug info, did not merge anything, now
20 it no longer has that merge list so only outputs:
21
22 emerge: It seems we have nothing to resume...
23
24
25 diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
26 index 83035c2..61ef31d 100644
27 --- a/pym/_emerge/depgraph.py
28 +++ b/pym/_emerge/depgraph.py
29 @@ -1942,8 +1942,9 @@ class depgraph(object):
30 # Display the specific atom from SetArg or
31 # Package types.
32 uneval = ""
33 - if dep.atom is not dep.atom.unevaluated_atom:
34 - uneval = " (%s)" % (dep.atom.unevaluated_atom,)
35 + if dep.atom and dep.atom.unevaluated_atom:
36 + if dep.atom is not dep.atom.unevaluated_atom:
37 + uneval = " (%s)" % (dep.atom.unevaluated_atom,)
38 writemsg_level(
39 "%s%s%s required by %s\n" %
40 ("Parent Dep:".ljust(15), dep.atom, uneval, myparent),
41 lines 1-16/16 (END)
42
43
44 This takes advantage of the fact that uneval is initialized to ""
45 Then only reassigns it if there is actually a mismatch.
46 --
47 Brian Dolbec <dolsen>

Replies