Display relevant FEATURES before setup phase
authorZac Medico <zmedico@gentoo.org>
Tue, 21 Dec 2010 17:35:25 +0000 (09:35 -0800)
committerZac Medico <zmedico@gentoo.org>
Tue, 21 Dec 2010 17:39:30 +0000 (09:39 -0800)
Thanks to Christian Ruppert <idl0r@gentoo.org> for the suggestion.

pym/_emerge/EbuildPhase.py

index 2135c62b23ed45770085f3ffddc99c7778a0d2fd..6197d81d6cc07db55a9d728ed739d7a68245ac01 100644 (file)
@@ -29,6 +29,13 @@ class EbuildPhase(CompositeTask):
 
        __slots__ = ("actionmap", "phase", "settings")
 
+       # FEATURES displayed prior to setup phase
+       _features_display = ("ccache", "distcc", "fakeroot",
+               "installsources", "keeptemp", "keepwork", "nostrip",
+               "preserve-libs", "sandbox", "selinux", "sesandbox",
+               "splitdebug", "suidctl", "test", "userpriv",
+               "usersandbox")
+
        def _start(self):
 
                need_builddir = self.phase not in EbuildProcess._phases_without_builddir
@@ -70,7 +77,14 @@ class EbuildPhase(CompositeTask):
                                msg.append("Repository: %s" % self.settings['PORTAGE_REPO_NAME'])
                        if maint_str:
                                msg.append("Maintainer: %s" % maint_str)
-                       msg.append("USE:  %s" % use)
+                       msg.append("USE:        %s" % use)
+                       relevant_features = []
+                       enabled_features = self.settings.features
+                       for x in self._features_display:
+                               if x in enabled_features:
+                                       relevant_features.append(x)
+                       if relevant_features:
+                               msg.append("FEATURES:   %s" % " ".join(relevant_features))
                        self._elog('einfo', msg)
 
                if self.phase == 'package':