el buggo pointed out via spyderous.
authorBrian Harring <ferringb@gentoo.org>
Wed, 4 Jan 2006 08:57:07 +0000 (08:57 -0000)
committerBrian Harring <ferringb@gentoo.org>
Wed, 4 Jan 2006 08:57:07 +0000 (08:57 -0000)
|| ( 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

index 59a48185d940338580c4efcc9933a39db06673ea..5467e005542bcf580fb74f683b0f789af69c2b6a 100644 (file)
@@ -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]