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>
Fri, 19 Nov 2010 23:21:53 +0000 (15:21 -0800)
This fixes a corner case in the code from the previous commit.

pym/portage/package/ebuild/config.py

index 5ece5b0f3b26730b17e2d10c4fadec924d8c2def..6c513c6965f42e6b36549b313637369bb50230e5 100644 (file)
@@ -1746,8 +1746,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)