package.bbclass: Use bb.fatal() instead of raising FuncFailed

This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.

Motivating quote below:

< kergoth> the *original* intent was for the function/task to error via
           whatever appropriate means, bb.fatal, whatever, and
           funcfailed was what you'd catch if you were calling
           exec_func/exec_task. that is, it's what those functions
           raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself

FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.

(From OE-Core rev: 8443b6f3f25181f5ac49bc25a1387cd05b814376)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ulf Magnusson 2016-10-01 04:47:08 +02:00 committed by Richard Purdie
parent 4c25460c5a
commit 4dbb0d73dd

View File

@ -1171,7 +1171,7 @@ python populate_packages () {
continue
ret = bb.utils.copyfile(file, fpath)
if ret is False or ret == 0:
raise bb.build.FuncFailed("File population failed")
bb.fatal("File population failed")
# Check if symlink paths exist
for file in symlink_paths: