Handle combination of incremental + USE_EXPAND
authorZac Medico <zmedico@gentoo.org>
Fri, 19 Nov 2010 23:21:53 +0000 (15:21 -0800)
committerZac Medico <zmedico@gentoo.org>
Wed, 24 Nov 2010 02:06:01 +0000 (18:06 -0800)
This fixes a corner case in the code from the previous commit.

pym/portage/package/ebuild/config.py

index 33b57c5ba7bf6e19c48dfcef71cdb0b1a0e1bb95..a84e8fe84fbc0dccd1094b874e605824c825e8a0 100644 (file)
@@ -1787,8 +1787,15 @@ class config(object):
                                        if v is None:
                                                continue
                                        prefix = k.lower() + '_'
-                                       for x in v.split():
-                                               expand_use.append(prefix + x)
+                                       if k in myincrementals:
+                                               for x in v.split():
+                                                       if x[:1] == '-':
+                                                               expand_use.append('-' + prefix + x[1:])
+                                                       else:
+                                                               expand_use.append(prefix + x)
+                                       else:
+                                               for x in v.split():
+                                                       expand_use.append(prefix + x)
                                if expand_use:
                                        expand_use.append(use)
                                        use  = ' '.join(expand_use)