diff options
Diffstat (limited to 'classes/sanity.bbclass')
-rw-r--r-- | classes/sanity.bbclass | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/classes/sanity.bbclass b/classes/sanity.bbclass index 958ab91fa6..016b0d500b 100644 --- a/classes/sanity.bbclass +++ b/classes/sanity.bbclass @@ -49,6 +49,9 @@ def check_sanity(e): print "Foo %s" % minversion return + if 0 == os.getuid(): + raise_sanity_error("Do not use Bitbake as root.") + messages = "" if (LooseVersion(__version__) < LooseVersion(minversion)): @@ -86,7 +89,7 @@ def check_sanity(e): if not check_app_exists('${BUILD_PREFIX}g++', e.data): missing = missing + "C++ Compiler (${BUILD_PREFIX}g++)," - required_utilities = "patch diffstat texi2html makeinfo cvs svn git bzip2 tar gzip gawk" + required_utilities = "patch help2man diffstat texi2html makeinfo cvs svn git bzip2 tar gzip gawk md5sum bison" for util in required_utilities.split(): if not check_app_exists( util, e.data ): @@ -108,6 +111,16 @@ python check_sanity_eventhandler() { from bb import note, error, data, __version__ from bb.event import getName + try: + from distutils.version import LooseVersion + except ImportError: + def LooseVersion(v): print "WARNING: sanity.bbclass can't compare versions without python-distutils"; return 1 + + if (LooseVersion(bb.__version__) > LooseVersion("1.8.6")): + if getName(e) == "ConfigParsed": + check_sanity(e) + return NotHandled + if getName(e) == "BuildStarted": check_sanity(e) |