From e6ced363811c3f99cf7223d5ffd58c7fd7320a09 Mon Sep 17 00:00:00 2001 From: Brian Harring Date: Wed, 4 Jan 2006 08:57:07 +0000 Subject: [PATCH] el buggo pointed out via spyderous. || ( a ( x? ( b ) y? ( c ) ) ) -x -y , was resulting in || ( a () ) the main consumer of this, portage.dep_check is stupid, and was assuming () was valid. It's not, obviously. Long term bug, around in at least .51 . Should correct dep_check handling of it also, but no reason to be handing () in the result lists also. svn path=/main/trunk/; revision=2522 --- pym/portage_dep.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pym/portage_dep.py b/pym/portage_dep.py index 59a48185d..5467e0055 100644 --- a/pym/portage_dep.py +++ b/pym/portage_dep.py @@ -79,7 +79,9 @@ def use_reduce(deparray, uselist=[], masklist=[], matchall=0, excludeall=[]): head = mydeparray.pop(0) if type(head) == types.ListType: - rlist = rlist + [use_reduce(head, uselist, masklist, matchall, excludeall)] + additions = use_reduce(head, uselist, masklist, matchall, excludeall) + if additions: + rlist.append(additions) else: if head[-1] == "?": # Use reduce next group on fail. @@ -122,7 +124,9 @@ def use_reduce(deparray, uselist=[], masklist=[], matchall=0, excludeall=[]): if ismatch: target = newdeparray[-1] if isinstance(target, list): - rlist += [use_reduce(target, uselist, masklist, matchall, excludeall)] + additions = use_reduce(target, uselist, masklist, matchall, excludeall) + if additions: + rlist.append(additions) else: rlist += [target] -- 2.26.2