* [gentoo-portage-dev] [PATCH] depgraph: Skip atoms that are None (bug 505944)
@ 2014-03-27 12:21 Alexander Berntsen
2014-03-27 16:16 ` Brian Dolbec
0 siblings, 1 reply; 3+ messages in thread
From: Alexander Berntsen @ 2014-03-27 12:21 UTC (permalink / raw
To: gentoo-portage-dev
Don't try to display atoms that are None when in debug mode.
---
Can I get an ACK on this please? Do share your ideas for refactoring,
if any. But even if this is not how we want it to work in the end, I
still think we should commit it to fix the bug.
pym/_emerge/depgraph.py | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index abb70a7..556cb08 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2211,12 +2211,13 @@ class depgraph(object):
# Display the specific atom from SetArg or
# Package types.
uneval = ""
- if dep.atom is not dep.atom.unevaluated_atom:
- uneval = " (%s)" % (dep.atom.unevaluated_atom,)
- writemsg_level(
- "%s%s%s required by %s\n" %
- ("Parent Dep:".ljust(15), dep.atom, uneval, myparent),
- level=logging.DEBUG, noiselevel=-1)
+ if dep.atom is not None:
+ if dep.atom is not dep.atom.unevaluated_atom:
+ uneval = " (%s)" % (dep.atom.unevaluated_atom,)
+ writemsg_level(
+ "%s%s%s required by %s\n" %
+ ("Parent Dep:".ljust(15), dep.atom, uneval, myparent),
+ level=logging.DEBUG, noiselevel=-1)
# Ensure that the dependencies of the same package
# are never processed more than once.
--
1.8.3.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [gentoo-portage-dev] [PATCH] depgraph: Skip atoms that are None (bug 505944)
2014-03-27 12:21 [gentoo-portage-dev] [PATCH] depgraph: Skip atoms that are None (bug 505944) Alexander Berntsen
@ 2014-03-27 16:16 ` Brian Dolbec
2014-03-28 9:07 ` Alexander Berntsen
0 siblings, 1 reply; 3+ messages in thread
From: Brian Dolbec @ 2014-03-27 16:16 UTC (permalink / raw
To: gentoo-portage-dev
On Thu, 27 Mar 2014 13:21:03 +0100
Alexander Berntsen <bernalex@gentoo.org> wrote:
> Don't try to display atoms that are None when in debug mode.
> ---
> Can I get an ACK on this please? Do share your ideas for refactoring,
> if any. But even if this is not how we want it to work in the end, I
> still think we should commit it to fix the bug.
>
>
This is not nearly bad enough a bug to commit a panic fix.
It is the result of a typo on the commandline only.
I did some testing on my system. This bug depends on there being a
resume list. During testing, I tried dropping the -p option in a root
terminal, with a different change applied to prevent the traceback.
It output a huge long list of debug info, did not merge anything, now
it no longer has that merge list so only outputs:
emerge: It seems we have nothing to resume...
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 83035c2..61ef31d 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1942,8 +1942,9 @@ class depgraph(object):
# Display the specific atom from SetArg or
# Package types.
uneval = ""
- if dep.atom is not dep.atom.unevaluated_atom:
- uneval = " (%s)" % (dep.atom.unevaluated_atom,)
+ if dep.atom and dep.atom.unevaluated_atom:
+ if dep.atom is not dep.atom.unevaluated_atom:
+ uneval = " (%s)" % (dep.atom.unevaluated_atom,)
writemsg_level(
"%s%s%s required by %s\n" %
("Parent Dep:".ljust(15), dep.atom, uneval, myparent),
lines 1-16/16 (END)
This takes advantage of the fact that uneval is initialized to ""
Then only reassigns it if there is actually a mismatch.
--
Brian Dolbec <dolsen>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [gentoo-portage-dev] [PATCH] depgraph: Skip atoms that are None (bug 505944)
2014-03-27 16:16 ` Brian Dolbec
@ 2014-03-28 9:07 ` Alexander Berntsen
0 siblings, 0 replies; 3+ messages in thread
From: Alexander Berntsen @ 2014-03-28 9:07 UTC (permalink / raw
To: gentoo-portage-dev
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 27/03/14 17:16, Brian Dolbec wrote:
> diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
> index 83035c2..61ef31d 100644 --- a/pym/_emerge/depgraph.py +++
> b/pym/_emerge/depgraph.py @@ -1942,8 +1942,9 @@ class
> depgraph(object): # Display the specific atom from SetArg or #
> Package types. uneval = "" - if
> dep.atom is not dep.atom.unevaluated_atom: -
> uneval = " (%s)" % (dep.atom.unevaluated_atom,) +
> if dep.atom and dep.atom.unevaluated_atom: +
> if dep.atom is not dep.atom.unevaluated_atom: +
> uneval = " (%s)" % (dep.atom.unevaluated_atom,) writemsg_level(
> "%s%s%s required by %s\n" % ("Parent Dep:".ljust(15), dep.atom,
> uneval, myparent), lines 1-16/16 (END)
>
>
> This takes advantage of the fact that uneval is initialized to ""
> Then only reassigns it if there is actually a mismatch.
Sure. I'd use one "if" instead of two.
- --
Alexander
bernalex@gentoo.org
https://secure.plaimi.net/~alexander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iF4EAREIAAYFAlM1O+UACgkQRtClrXBQc7XL+AD/Wn5sbE/O3QFAl7nBYblVWFAK
LBVwmY3XEOT2blgIPfIA/2a8IspgldZxO2AmLQ/bZNnFcigUPejaZ1V8J97JJuiu
=qc0Y
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-03-28 9:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-27 12:21 [gentoo-portage-dev] [PATCH] depgraph: Skip atoms that are None (bug 505944) Alexander Berntsen
2014-03-27 16:16 ` Brian Dolbec
2014-03-28 9:07 ` Alexander Berntsen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox