diff options
author | Richard Purdie <rpurdie@rpsys.net> | 2006-11-04 12:25:00 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@rpsys.net> | 2006-11-04 12:25:00 +0000 |
commit | 3dd8504250574299942e866fc97ca0dbd8b00413 (patch) | |
tree | e9740e1fca62261284614c0449e15f9f6bfd26d9 /classes/sanity.bbclass | |
parent | c119cdd62d87956a2094cf763b55732d13910494 (diff) |
sanity.bbclass: Show all errors in one error message (from poky). Also add dependency on gawk
Diffstat (limited to 'classes/sanity.bbclass')
-rw-r--r-- | classes/sanity.bbclass | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/classes/sanity.bbclass b/classes/sanity.bbclass index 64c1bc0a0c..958ab91fa6 100644 --- a/classes/sanity.bbclass +++ b/classes/sanity.bbclass @@ -49,48 +49,59 @@ def check_sanity(e): print "Foo %s" % minversion return + messages = "" + if (LooseVersion(__version__) < LooseVersion(minversion)): - raise_sanity_error('Bitbake version %s is required and version %s was found' % (minversion, __version__)) + messages = messages + 'Bitbake version %s is required and version %s was found\n' % (minversion, __version__) # Check TARGET_ARCH is set if data.getVar('TARGET_ARCH', e.data, True) == 'INVALID': - raise_sanity_error('Please set TARGET_ARCH directly, or choose a MACHINE or DISTRO that does so.') + messages = messages + 'Please set TARGET_ARCH directly, or choose a MACHINE or DISTRO that does so.\n' # Check TARGET_OS is set if data.getVar('TARGET_OS', e.data, True) == 'INVALID': - raise_sanity_error('Please set TARGET_OS directly, or choose a MACHINE or DISTRO that does so.') + messages = messages + 'Please set TARGET_OS directly, or choose a MACHINE or DISTRO that does so.\n' # Check user doesn't have ASSUME_PROVIDED = instead of += in local.conf if "diffstat-native" not in data.getVar('ASSUME_PROVIDED', e.data, True).split(): - raise_sanity_error('Please use ASSUME_PROVIDED +=, not ASSUME_PROVIDED = in your local.conf') + messages = messages + 'Please use ASSUME_PROVIDED +=, not ASSUME_PROVIDED = in your local.conf\n' # Check that the MACHINE is valid if not check_conf_exists("conf/machine/${MACHINE}.conf", e.data): - raise_sanity_error('Please set a valid MACHINE in your local.conf') + messages = messages + 'Please set a valid MACHINE in your local.conf\n' # Check that the DISTRO is valid # need to take into account DISTRO renaming DISTRO if not ( check_conf_exists("conf/distro/${DISTRO}.conf", e.data) or check_conf_exists("conf/distro/include/${DISTRO}.inc", e.data) ): - raise_sanity_error("DISTRO '%s' not found. Please set a valid DISTRO in your local.conf" % data.getVar("DISTRO", e.data, True )) + messages = messages + "DISTRO '%s' not found. Please set a valid DISTRO in your local.conf\n" % data.getVar("DISTRO", e.data, True ) + + missing = "" if not check_app_exists("${MAKE}", e.data): - raise_sanity_error('GNU make missing. Please install GNU make') + missing = missing + "GNU make," if not check_app_exists('${BUILD_PREFIX}gcc', e.data): - raise_sanity_error('C Host-Compiler is missing, please install one' ) + missing = missing + "C Compiler (${BUILD_PREFIX}gcc)," if not check_app_exists('${BUILD_PREFIX}g++', e.data): - raise_sanity_error('C++ Host-Compiler is missing, please install one' ) + missing = missing + "C++ Compiler (${BUILD_PREFIX}g++)," - required_utilities = "patch diffstat texi2html makeinfo cvs svn git bzip2 tar gzip" + required_utilities = "patch diffstat texi2html makeinfo cvs svn git bzip2 tar gzip gawk" for util in required_utilities.split(): if not check_app_exists( util, e.data ): - raise_sanity_error( "Please install the %s utility." % util ) + missing = missing + "%s," % util + + if missing != "": + missing = missing.rstrip(',') + messages = messages + "Please install following missing utilities: %s\n" % missing oes_bb_conf = data.getVar( 'OES_BITBAKE_CONF', e.data, True ) if not oes_bb_conf: - raise_sanity_error('You do not include OpenEmbeddeds version of conf/bitbake.conf') + messages = messages + 'You do not include OpenEmbeddeds version of conf/bitbake.conf\n' + + if messages != "": + raise_sanity_error(messages) addhandler check_sanity_eventhandler python check_sanity_eventhandler() { |