diff options
| -rw-r--r-- | meta/classes-recipe/image.bbclass | 15 | ||||
| -rw-r--r-- | meta/lib/oe/utils.py | 13 |
2 files changed, 4 insertions, 24 deletions
diff --git a/meta/classes-recipe/image.bbclass b/meta/classes-recipe/image.bbclass index 834ae03f3c..00f1d58f23 100644 --- a/meta/classes-recipe/image.bbclass +++ b/meta/classes-recipe/image.bbclass | |||
| @@ -324,27 +324,20 @@ addtask do_image_complete_setscene | |||
| 324 | # IMAGE_QA_COMMANDS += " \ | 324 | # IMAGE_QA_COMMANDS += " \ |
| 325 | # image_check_everything_ok \ | 325 | # image_check_everything_ok \ |
| 326 | # " | 326 | # " |
| 327 | # | ||
| 327 | # This task runs all functions in IMAGE_QA_COMMANDS after the rootfs | 328 | # This task runs all functions in IMAGE_QA_COMMANDS after the rootfs |
| 328 | # construction has completed in order to validate the resulting image. | 329 | # construction has completed in order to validate the resulting image. |
| 329 | # | 330 | # |
| 330 | # The functions should use ${IMAGE_ROOTFS} to find the unpacked rootfs | 331 | # The functions should use ${IMAGE_ROOTFS} to find the unpacked rootfs |
| 331 | # directory, which if QA passes will be the basis for the images. | 332 | # directory, which if QA passes will be the basis for the images. |
| 332 | # | 333 | # |
| 333 | # The functions should use oe.utils.ImageQAFailed(description, name) to raise | 334 | # The functions are expected to call oe.qa.handle_error() to report any |
| 334 | # errors. The name must be listed in ERROR_QA or WARN_QA to prompt. | 335 | # problems. |
| 335 | fakeroot python do_image_qa () { | 336 | fakeroot python do_image_qa () { |
| 336 | from oe.utils import ImageQAFailed | ||
| 337 | |||
| 338 | qa_cmds = (d.getVar('IMAGE_QA_COMMANDS') or '').split() | 337 | qa_cmds = (d.getVar('IMAGE_QA_COMMANDS') or '').split() |
| 339 | 338 | ||
| 340 | for cmd in qa_cmds: | 339 | for cmd in qa_cmds: |
| 341 | try: | 340 | bb.build.exec_func(cmd, d) |
| 342 | bb.build.exec_func(cmd, d) | ||
| 343 | except oe.utils.ImageQAFailed as e: | ||
| 344 | qamsg = 'Image QA function %s failed: %s\n' % (e.name, e.description) | ||
| 345 | oe.qa.handle_error(e.name, qamsg, d) | ||
| 346 | except Exception as e: | ||
| 347 | qamsg = qamsg + '\tImage QA function %s failed: %s\n' % (cmd, e) | ||
| 348 | 341 | ||
| 349 | oe.qa.exit_if_errors(d) | 342 | oe.qa.exit_if_errors(d) |
| 350 | } | 343 | } |
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index 83f1440887..c9c7a47041 100644 --- a/meta/lib/oe/utils.py +++ b/meta/lib/oe/utils.py | |||
| @@ -482,19 +482,6 @@ def get_multilib_datastore(variant, d): | |||
| 482 | localdata.setVar("MLPREFIX", "") | 482 | localdata.setVar("MLPREFIX", "") |
| 483 | return localdata | 483 | return localdata |
| 484 | 484 | ||
| 485 | class ImageQAFailed(bb.BBHandledException): | ||
| 486 | def __init__(self, description, name=None, logfile=None): | ||
| 487 | self.description = description | ||
| 488 | self.name = name | ||
| 489 | self.logfile=logfile | ||
| 490 | |||
| 491 | def __str__(self): | ||
| 492 | msg = 'Function failed: %s' % self.name | ||
| 493 | if self.description: | ||
| 494 | msg = msg + ' (%s)' % self.description | ||
| 495 | |||
| 496 | return msg | ||
| 497 | |||
| 498 | def sh_quote(string): | 485 | def sh_quote(string): |
| 499 | import shlex | 486 | import shlex |
| 500 | return shlex.quote(string) | 487 | return shlex.quote(string) |
