All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bitbake: support $BITBAKE_UI environment
@ 2012-05-20 15:19 Enrico Scholz
  2012-05-23 10:30 ` Richard Purdie
  0 siblings, 1 reply; 2+ messages in thread
From: Enrico Scholz @ 2012-05-20 15:19 UTC (permalink / raw)
  To: bitbake-devel; +Cc: Enrico Scholz

Patch adds support for a $BITBAKE_UI environment variable which allows
to configure the preferred user interface. Although an '-u' option
(which will override the environment variable) exists already, it was
required to specify this option on every invocation of bitbake.

Because user interface is instanciated very early in the program it is
not possible to use bitbake.conf for setting up a default.  An
environment variable (which acts in a similar category like $PAGER or
$EDITOR) is a simple way for configuring the default.

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
---
 bin/bitbake   |    9 +++++----
 doc/bitbake.1 |    6 ++++++
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/bin/bitbake b/bin/bitbake
index 420e69d..478ac06 100755
--- a/bin/bitbake
+++ b/bin/bitbake
@@ -56,10 +56,11 @@ class BBConfiguration(object):
 
 
 def get_ui(config):
-    if config.ui:
-        interface = config.ui
-    else:
-        interface = 'knotty'
+    if not config.ui:
+        # modify 'ui' attribute because it is also read by cooker
+        config.ui = os.environ.get('BITBAKE_UI', 'knotty')
+
+    interface = config.ui
 
     try:
         # Dynamically load the UI based on the ui name. Although we
diff --git a/doc/bitbake.1 b/doc/bitbake.1
index aa09620..d9d3902 100644
--- a/doc/bitbake.1
+++ b/doc/bitbake.1
@@ -103,7 +103,13 @@ Show debug logging for the specified logging domains
 .TP
 .B \-P, \-\-profile
 profile the command and print a report
+
+.SH ENVIRONMENT VARIABLES
+bitbake uses the following environment variables to control its
+operation:
 .TP
+.B BITBAKE_UI
+The bitbake user interface; overridden by the \fB-u\fP commandline option.
 
 .SH AUTHORS
 BitBake was written by 
-- 
1.7.7.6




^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-05-23 10:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-20 15:19 [PATCH] bitbake: support $BITBAKE_UI environment Enrico Scholz
2012-05-23 10:30 ` Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.