* [PATCH 0/2] sanity.bbclass improvements for Hob
@ 2012-05-28 17:10 Paul Eggleton
2012-05-28 17:10 ` [PATCH 1/2] classes/sanity: send sanity check failure as a separate event " Paul Eggleton
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Paul Eggleton @ 2012-05-28 17:10 UTC (permalink / raw)
To: openembedded-core
The following changes since commit 363424cdc78cafa278008f973c2b4288297ebf8c:
image.bbclass: Ensure ${S} is cleaned at the start of rootfs generation (2012-05-25 11:28:00 +0100)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib paule/hob-sanity-oecore
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/hob-sanity-oecore
Paul Eggleton (2):
classes/sanity: send sanity check failure as a separate event for Hob
classes/sanity: fix a couple of grammatical errors in messages
meta/classes/sanity.bbclass | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] classes/sanity: send sanity check failure as a separate event for Hob
2012-05-28 17:10 [PATCH 0/2] sanity.bbclass improvements for Hob Paul Eggleton
@ 2012-05-28 17:10 ` Paul Eggleton
2012-05-28 17:10 ` [PATCH 2/2] classes/sanity: fix a couple of grammatical errors in messages Paul Eggleton
2012-05-30 12:01 ` [PATCH 0/2] sanity.bbclass improvements for Hob Richard Purdie
2 siblings, 0 replies; 4+ messages in thread
From: Paul Eggleton @ 2012-05-28 17:10 UTC (permalink / raw)
To: openembedded-core
In order to show a friendlier error message within Hob that does not
bury the actual sanity error in our typical preamble about disabling
sanity checks, use a separate event to indicate that sanity checks
failed.
This change is intended to work together with the related change to
BitBake, however it has a check to ensure that it does not fail with
older versions that do not include that change.
Fixes [YOCTO #2336].
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
meta/classes/sanity.bbclass | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index a2b45bc..8a09b6d 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -4,7 +4,16 @@
SANITY_REQUIRED_UTILITIES ?= "patch diffstat texi2html makeinfo svn bzip2 tar gzip gawk chrpath wget cpio"
-def raise_sanity_error(msg):
+def raise_sanity_error(msg, d):
+ if d.getVar("SANITY_USE_EVENTS", True) == "1":
+ # FIXME: handle when BitBake version is too old to support bb.event.SanityCheckFailed
+ # We can just fire the event directly once the minimum version is bumped beyond 1.15.1
+ try:
+ bb.event.fire(bb.event.SanityCheckFailed(msg), d)
+ return
+ except AttributeError:
+ pass
+
bb.fatal(""" OE-core's config sanity checker detected a potential misconfiguration.
Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
Following is the list of potential problems / advisories:
@@ -298,7 +307,7 @@ def check_sanity(sanity_data):
return
if 0 == os.getuid():
- raise_sanity_error("Do not use Bitbake as root.")
+ raise_sanity_error("Do not use Bitbake as root.", sanity_data)
messages = ""
@@ -532,7 +541,7 @@ def check_sanity(sanity_data):
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."
if messages != "":
- raise_sanity_error(messages)
+ raise_sanity_error(messages, sanity_data)
# Create a copy of the datastore and finalise it to ensure appends and
# overrides are set - the datastore has yet to be finalised at ConfigParsed
@@ -548,6 +557,7 @@ python check_sanity_eventhandler() {
check_sanity(sanity_data)
elif bb.event.getName(e) == "SanityCheck":
sanity_data = copy_data(e)
+ sanity_data.setVar("SANITY_USE_EVENTS", "1")
check_sanity(sanity_data)
bb.event.fire(bb.event.SanityCheckPassed(), e.data)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] classes/sanity: fix a couple of grammatical errors in messages
2012-05-28 17:10 [PATCH 0/2] sanity.bbclass improvements for Hob Paul Eggleton
2012-05-28 17:10 ` [PATCH 1/2] classes/sanity: send sanity check failure as a separate event " Paul Eggleton
@ 2012-05-28 17:10 ` Paul Eggleton
2012-05-30 12:01 ` [PATCH 0/2] sanity.bbclass improvements for Hob Richard Purdie
2 siblings, 0 replies; 4+ messages in thread
From: Paul Eggleton @ 2012-05-28 17:10 UTC (permalink / raw)
To: openembedded-core
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
meta/classes/sanity.bbclass | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 8a09b6d..3ffb915 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -409,7 +409,7 @@ def check_sanity(sanity_data):
if missing != "":
missing = missing.rstrip(',')
- messages = messages + "Please install following missing utilities: %s\n" % missing
+ messages = messages + "Please install the following missing utilities: %s\n" % missing
pseudo_msg = check_pseudo_wrapper()
if pseudo_msg != "":
@@ -431,7 +431,7 @@ def check_sanity(sanity_data):
oes_bb_conf = sanity_data.getVar( 'OES_BITBAKE_CONF', True)
if not oes_bb_conf:
- messages = messages + 'You do not include OpenEmbeddeds version of conf/bitbake.conf. This means your environment is misconfigured, in particular check BBPATH.\n'
+ messages = messages + 'You do not include the OpenEmbedded version of conf/bitbake.conf. This means your environment is misconfigured, in particular check BBPATH.\n'
nolibs = sanity_data.getVar('NO32LIBS', True)
if not nolibs:
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] sanity.bbclass improvements for Hob
2012-05-28 17:10 [PATCH 0/2] sanity.bbclass improvements for Hob Paul Eggleton
2012-05-28 17:10 ` [PATCH 1/2] classes/sanity: send sanity check failure as a separate event " Paul Eggleton
2012-05-28 17:10 ` [PATCH 2/2] classes/sanity: fix a couple of grammatical errors in messages Paul Eggleton
@ 2012-05-30 12:01 ` Richard Purdie
2 siblings, 0 replies; 4+ messages in thread
From: Richard Purdie @ 2012-05-30 12:01 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On Mon, 2012-05-28 at 18:10 +0100, Paul Eggleton wrote:
> The following changes since commit 363424cdc78cafa278008f973c2b4288297ebf8c:
>
> image.bbclass: Ensure ${S} is cleaned at the start of rootfs generation (2012-05-25 11:28:00 +0100)
>
> are available in the git repository at:
>
> git://git.openembedded.org/openembedded-core-contrib paule/hob-sanity-oecore
> http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/hob-sanity-oecore
>
> Paul Eggleton (2):
> classes/sanity: send sanity check failure as a separate event for Hob
> classes/sanity: fix a couple of grammatical errors in messages
Merged to master, thanks.
Richard
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-05-30 12:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-28 17:10 [PATCH 0/2] sanity.bbclass improvements for Hob Paul Eggleton
2012-05-28 17:10 ` [PATCH 1/2] classes/sanity: send sanity check failure as a separate event " Paul Eggleton
2012-05-28 17:10 ` [PATCH 2/2] classes/sanity: fix a couple of grammatical errors in messages Paul Eggleton
2012-05-30 12:01 ` [PATCH 0/2] sanity.bbclass improvements for Hob Richard Purdie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox