summaryrefslogtreecommitdiffstats
path: root/meta/classes/sanity.bbclass
diff options
context:
space:
mode:
authorCristiana Voicu <cristiana.voicu@intel.com>2013-02-12 15:27:32 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-02-15 12:17:35 +0000
commit2cbefb8387676c453c05de909fa3cdc206bdad9f (patch)
tree51724dae7c9ac667cb7964b69d36d3c0ab2bf654 /meta/classes/sanity.bbclass
parent70b731c6f0728e1f38311e54e1d28d0c3418d06c (diff)
downloadpoky-2cbefb8387676c453c05de909fa3cdc206bdad9f.tar.gz
sanity.bbclass: when bblayers.conf is updated, it invokes a reparse
When bblayers.conf is updated(when sanity check is running), it should tell to bitbake to reparse configuration files. I will send a patch to bitbake-devel, with the actions needed in bitbake and hob. [YOCTO #3213] (From OE-Core rev: 5db1ff93f7204b43b7242fc7ef415216eb632ed8) Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sanity.bbclass')
-rw-r--r--meta/classes/sanity.bbclass18
1 files changed, 9 insertions, 9 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index e1888ba34b..15998755c1 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -344,6 +344,7 @@ def check_sanity_validmachine(sanity_data):
344def check_sanity(sanity_data): 344def check_sanity(sanity_data):
345 import subprocess 345 import subprocess
346 346
347 reparse = False
347 try: 348 try:
348 from distutils.version import LooseVersion 349 from distutils.version import LooseVersion
349 except ImportError: 350 except ImportError:
@@ -384,7 +385,7 @@ def check_sanity(sanity_data):
384 messages = messages + 'Please set a MACHINE in your local.conf or environment\n' 385 messages = messages + 'Please set a MACHINE in your local.conf or environment\n'
385 machinevalid = False 386 machinevalid = False
386 387
387 # Check we are using a valid lacal.conf 388 # Check we are using a valid local.conf
388 current_conf = sanity_data.getVar('CONF_VERSION', True) 389 current_conf = sanity_data.getVar('CONF_VERSION', True)
389 conf_version = sanity_data.getVar('LOCALCONF_VERSION', True) 390 conf_version = sanity_data.getVar('LOCALCONF_VERSION', True)
390 391
@@ -397,12 +398,8 @@ def check_sanity(sanity_data):
397 if current_lconf != lconf_version: 398 if current_lconf != lconf_version:
398 try: 399 try:
399 bb.build.exec_func("check_bblayers_conf", sanity_data) 400 bb.build.exec_func("check_bblayers_conf", sanity_data)
400 if sanity_data.getVar("SANITY_USE_EVENTS", True) == "1": 401 bb.note("Your conf/bblayers.conf has been automatically updated.")
401 bb.event.fire(bb.event.SanityCheckFailed("Your conf/bblayers.conf has been automatically updated. Please close and re-run."), sanity_data) 402 reparse = True
402 return
403 else:
404 bb.note("Your conf/bblayers.conf has been automatically updated. Please re-run %s." % os.path.basename(sys.argv[0]))
405 sys.exit(0)
406 except Exception: 403 except Exception:
407 messages = messages + "Your version of bblayers.conf was generated from an older version of bblayers.conf.sample and there have been updates made to this file. Please compare the two files and merge any changes before continuing.\nMatching the version numbers will remove this message.\n\"meld conf/bblayers.conf ${COREBASE}/meta*/conf/bblayers.conf.sample\" is a good way to visualise the changes.\n" 404 messages = messages + "Your version of bblayers.conf was generated from an older version of bblayers.conf.sample and there have been updates made to this file. Please compare the two files and merge any changes before continuing.\nMatching the version numbers will remove this message.\n\"meld conf/bblayers.conf ${COREBASE}/meta*/conf/bblayers.conf.sample\" is a good way to visualise the changes.\n"
408 405
@@ -630,6 +627,7 @@ def check_sanity(sanity_data):
630 627
631 if messages != "": 628 if messages != "":
632 raise_sanity_error(sanity_data.expand(messages), sanity_data, network_error) 629 raise_sanity_error(sanity_data.expand(messages), sanity_data, network_error)
630 return reparse
633 631
634# Create a copy of the datastore and finalise it to ensure appends and 632# Create a copy of the datastore and finalise it to ensure appends and
635# overrides are set - the datastore has yet to be finalised at ConfigParsed 633# overrides are set - the datastore has yet to be finalised at ConfigParsed
@@ -642,11 +640,13 @@ addhandler check_sanity_eventhandler
642python check_sanity_eventhandler() { 640python check_sanity_eventhandler() {
643 if bb.event.getName(e) == "ConfigParsed" and e.data.getVar("BB_WORKERCONTEXT", True) != "1" and e.data.getVar("DISABLE_SANITY_CHECKS", True) != "1": 641 if bb.event.getName(e) == "ConfigParsed" and e.data.getVar("BB_WORKERCONTEXT", True) != "1" and e.data.getVar("DISABLE_SANITY_CHECKS", True) != "1":
644 sanity_data = copy_data(e) 642 sanity_data = copy_data(e)
645 check_sanity(sanity_data) 643 reparse = check_sanity(sanity_data)
644 e.data.setVar("BB_INVALIDCONF", reparse)
646 elif bb.event.getName(e) == "SanityCheck": 645 elif bb.event.getName(e) == "SanityCheck":
647 sanity_data = copy_data(e) 646 sanity_data = copy_data(e)
648 sanity_data.setVar("SANITY_USE_EVENTS", "1") 647 sanity_data.setVar("SANITY_USE_EVENTS", "1")
649 check_sanity(sanity_data) 648 reparse = check_sanity(sanity_data)
649 e.data.setVar("BB_INVALIDCONF", reparse)
650 bb.event.fire(bb.event.SanityCheckPassed(), e.data) 650 bb.event.fire(bb.event.SanityCheckPassed(), e.data)
651 elif bb.event.getName(e) == "NetworkTest": 651 elif bb.event.getName(e) == "NetworkTest":
652 sanity_data = copy_data(e) 652 sanity_data = copy_data(e)