summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-09-05 14:25:51 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-09-05 16:32:14 (GMT)
commit8d6ecfbe84f0e266be1a7b25225845352476e42c (patch)
tree3c191210d430874ecdb10fce5a9c2ba1a3f6d29e
parent99c85ba93075a1aff789cafabbacf42e6a93bd32 (diff)
downloadpoky-8d6ecfbe84f0e266be1a7b25225845352476e42c.tar.gz
sanity.bbclass: Move back to running at ConfigParsed time
If we don't do this, users can get extremely confused errors since the sanity tests happen too late (after parsing) and don't see the warnings. Also cleanup messages about merging configuration file changes to give better hints at where the updated files may be. (From OE-Core rev: 7b8a68cda7ef8186e834b39e73ee12a55b33f85b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/sanity.bbclass10
1 files changed, 5 insertions, 5 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 40d8211..8f42fca 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -333,20 +333,20 @@ def check_sanity(sanity_data):
333 conf_version = sanity_data.getVar('LOCALCONF_VERSION', True) 333 conf_version = sanity_data.getVar('LOCALCONF_VERSION', True)
334 334
335 if current_conf != conf_version: 335 if current_conf != conf_version:
336 messages = messages + "Your version of local.conf was generated from an older version of local.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/local.conf conf/local.conf.sample\" is a good way to visualise the changes.\n" 336 messages = messages + "Your version of local.conf was generated from an older version of local.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/local.conf ${COREBASE}/meta*/conf/local.conf.sample\" is a good way to visualise the changes.\n"
337 337
338 # Check bblayers.conf is valid 338 # Check bblayers.conf is valid
339 current_lconf = sanity_data.getVar('LCONF_VERSION', True) 339 current_lconf = sanity_data.getVar('LCONF_VERSION', True)
340 lconf_version = sanity_data.getVar('LAYER_CONF_VERSION', True) 340 lconf_version = sanity_data.getVar('LAYER_CONF_VERSION', True)
341 if current_lconf != lconf_version: 341 if current_lconf != lconf_version:
342 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 conf/bblayers.conf.sample\" is a good way to visualise the changes.\n" 342 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"
343 343
344 # If we have a site.conf, check it's valid 344 # If we have a site.conf, check it's valid
345 if check_conf_exists("conf/site.conf", sanity_data): 345 if check_conf_exists("conf/site.conf", sanity_data):
346 current_sconf = sanity_data.getVar('SCONF_VERSION', True) 346 current_sconf = sanity_data.getVar('SCONF_VERSION', True)
347 sconf_version = sanity_data.getVar('SITE_CONF_VERSION', True) 347 sconf_version = sanity_data.getVar('SITE_CONF_VERSION', True)
348 if current_sconf != sconf_version: 348 if current_sconf != sconf_version:
349 messages = messages + "Your version of site.conf was generated from an older version of site.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/site.conf conf/site.conf.sample\" is a good way to visualise the changes.\n" 349 messages = messages + "Your version of site.conf was generated from an older version of site.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/site.conf ${COREBASE}/meta*/conf/site.conf.sample\" is a good way to visualise the changes.\n"
350 350
351 assume_provided = sanity_data.getVar('ASSUME_PROVIDED', True).split() 351 assume_provided = sanity_data.getVar('ASSUME_PROVIDED', True).split()
352 # Check user doesn't have ASSUME_PROVIDED = instead of += in local.conf 352 # Check user doesn't have ASSUME_PROVIDED = instead of += in local.conf
@@ -556,7 +556,7 @@ def check_sanity(sanity_data):
556 messages = messages + "Error, you have a space in your COREBASE directory path. Please move the installation to a directory which doesn't include a space." 556 messages = messages + "Error, you have a space in your COREBASE directory path. Please move the installation to a directory which doesn't include a space."
557 557
558 if messages != "": 558 if messages != "":
559 raise_sanity_error(messages, sanity_data) 559 raise_sanity_error(sanity_data.expand(messages), sanity_data)
560 560
561# Create a copy of the datastore and finalise it to ensure appends and 561# Create a copy of the datastore and finalise it to ensure appends and
562# overrides are set - the datastore has yet to be finalised at ConfigParsed 562# overrides are set - the datastore has yet to be finalised at ConfigParsed
@@ -567,7 +567,7 @@ def copy_data(e):
567 567
568addhandler check_sanity_eventhandler 568addhandler check_sanity_eventhandler
569python check_sanity_eventhandler() { 569python check_sanity_eventhandler() {
570 if bb.event.getName(e) == "BuildStarted" and e.data.getVar("BB_WORKERCONTEXT", True) != "1" and e.data.getVar("DISABLE_SANITY_CHECKS", True) != "1": 570 if bb.event.getName(e) == "ConfigParsed" and e.data.getVar("BB_WORKERCONTEXT", True) != "1" and e.data.getVar("DISABLE_SANITY_CHECKS", True) != "1":
571 sanity_data = copy_data(e) 571 sanity_data = copy_data(e)
572 check_sanity(sanity_data) 572 check_sanity(sanity_data)
573 elif bb.event.getName(e) == "SanityCheck": 573 elif bb.event.getName(e) == "SanityCheck":