sanity.bbclass: Warn people when TERMCMD is set to a non-installed program

We default to gnome-terminal for TERMCMD (and TERMRUNCMD) so should check that
this program actually exists during sanity checking.

As a corollary document how to change these variables in the local.conf

Signed-off-by: Joshua Lock <josh@linux.intel.com>
This commit is contained in:
Joshua Lock 2010-11-26 16:43:05 +00:00 committed by Richard Purdie
parent d5f08073f5
commit 63b85e74a3
2 changed files with 13 additions and 0 deletions

View File

@ -139,6 +139,12 @@ def check_sanity(e):
missing = missing.rstrip(',')
messages = messages + "Please install following missing utilities: %s\n" % missing
# Ensure we have the binary for TERMCMD, as when patch application fails the error is fairly intimidating
termcmd = data.getVar("TERMCMD", e.data, True)
term = termcmd.split()[0]
if not check_app_exists(term, e.data):
messages = messages + "The console for use in patch error resolution is not available, please install %s or set TERMCMD and TERMCMDRUN (as documented in local.conf).\n" % term
if os.path.basename(os.readlink('/bin/sh')) == 'dash':
messages = messages + "Using dash as /bin/sh causes various subtle build problems, please use bash instead (e.g. 'dpkg-reconfigure dash' on an Ubuntu system.\n"

View File

@ -170,3 +170,10 @@ ENABLE_BINARY_LOCALE_GENERATION = "1"
# out if that is desired
NO32LIBS = "1"
# If you do not use (or have installed) gnome-terminal you will need to
# uncomment these variables and set them to the terminal you wish to use
# when resolving patches which cannot be applied
# Supported shell prefixes for *_TERMCMD and *_TERMCMDRUN ARE:
# GNOME, SCREEN, XTERM and KONSOLE
#TERMCMD = "${KONSOLE_TERMCMD}"
#TERMCMDRUN = "${KONSOLE_TERMCMDRUN}"