Index: pym/portage/__init__.py =================================================================== --- pym/portage/__init__.py (revision 12696) +++ pym/portage/__init__.py (working copy) @@ -2119,6 +2119,8 @@ if ebuild_force_test: self.usemask.discard("test") + use.difference_update([x for x in use if x not in iuse_implicit]) + # Use the calculated USE flags to regenerate the USE_EXPAND flags so # that they are consistent. For optimal performance, use slice # comparison instead of startswith(). @@ -2189,9 +2191,7 @@ # attribute since we still want to be able to see global USE # settings for things like emerge --info. - self.configdict["pkg"]["PORTAGE_USE"] = " ".join(sorted( - x for x in use if \ - x in iuse_implicit)) + self.configdict["pkg"]["PORTAGE_USE"] = " ".join(sorted(use)) def _get_implicit_iuse(self): """