[OE-core] [PATCH 1/2] Rework how the devshell functions

Richard Purdie richard.purdie at linuxfoundation.org
Wed Jul 13 19:36:11 UTC 2011


On Wed, 2011-07-13 at 11:35 -0700, Christopher Larson wrote:
> From: Chris Larson <chris_larson at mentor.com>
> 
> In the new implementation, each known terminal is defined as a class in
> oe.terminal, as a subclass of bb.process.Popen.  terminal.bbclass wraps this
> functionality, providing the metadata pieces.  It obeys the OE_TERMINAL
> variable, which is a 'choice' typed variable.  This variable may be 'auto',
> 'none', or any of the names of the defined terminals.
> 
> When using 'auto', or requesting an unsupported terminal, we attempt to spawn
> them in priority order until we get one that's available on this system (and
> in the case of the X terminals, has DISPLAY defined).  The 'none' value is
> used when we're doing things like automated builds, and want to ensure that no
> terminal is *ever* spawned, under any circumstances.
> 
> Current available terminals:
> 
>     gnome
>     konsole
>     xterm
>     rxvt
>     screen
> 
> Signed-off-by: Chris Larson <chris_larson at mentor.com>
> ---
>  meta/classes/devshell.bbclass |   29 +++++-------
>  meta/classes/terminal.bbclass |   30 ++++++++++++
>  meta/lib/oe/terminal.py       |  102 +++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 144 insertions(+), 17 deletions(-)
>  create mode 100644 meta/classes/terminal.bbclass
>  create mode 100644 meta/lib/oe/terminal.py
> 
> diff --git a/meta/classes/devshell.bbclass b/meta/classes/devshell.bbclass
> index 5f262f4..95c29f3 100644
> --- a/meta/classes/devshell.bbclass
> +++ b/meta/classes/devshell.bbclass
> @@ -1,22 +1,17 @@
> -do_devshell[dirs] = "${S}"
> -do_devshell[nostamp] = "1"
> +inherit terminal
>  
> -XAUTHORITY ?= "${HOME}/.Xauthority"
>  
> -devshell_do_devshell() {
> -	export DISPLAY='${DISPLAY}'
> -	export DBUS_SESSION_BUS_ADDRESS='${DBUS_SESSION_BUS_ADDRESS}'
> -	export XAUTHORITY='${XAUTHORITY}'
> -	export TERMWINDOWTITLE="Bitbake Developer Shell"
> -	export EXTRA_OEMAKE='${EXTRA_OEMAKE}'
> -	export SHELLCMDS="bash"
> -	${TERMCMDRUN}
> -	if [ $? -ne 0 ]; then
> -	    echo "Fatal: '${TERMCMD}' not found. Check TERMCMD variable."
> -	    exit 1
> -	fi
> +export XAUTHORITY ?= "${HOME}/.Xauthority"
> +export SHELL ?= "bash"
> +export DBUS_SESSION_BUS_ADDRESS
> +export DISPLAY
> +export EXTRA_OEMAKE

Variables that are placed into the global environment affect the
checksums of any shell tasks when they change so I don't think we can do
this (and its why they are in a function as above).

Perhaps we could list the variables we want to export in a variable and
then pass that list to popen's environment?

Cheers,

Richard





More information about the Openembedded-core mailing list