diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-07-31 15:59:59 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-08-06 11:24:26 +0100 |
commit | 546c32753b2f0c2174c360ba83a7d2f7ffbb33f7 (patch) | |
tree | 85adaffbf373b0c2d4c94e9b8fba7ef9835ccd3b /meta/classes | |
parent | d9cb21854b139e9f8620ee256a3957db542494da (diff) | |
download | poky-546c32753b2f0c2174c360ba83a7d2f7ffbb33f7.tar.gz |
classes/lib: Remove bb.build.FuncFailed
Whilst seemingly a good idea, this exception doesn't really serve any purpose
that bb.fatal() doesn't cover. Wrapping exceptions within exceptions isn't
pythonic.
Its not used in many places, lets clean up those and remove usage of it
entirely. It may ultimately be dropped form bitbake entirely.
(From OE-Core rev: efe87ce4b2154c6f1c591ed9d8f770c229b044ad)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/go.bbclass | 18 | ||||
-rw-r--r-- | meta/classes/image.bbclass | 7 |
2 files changed, 9 insertions, 16 deletions
diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass index f303a15eaf..e40e55689d 100644 --- a/meta/classes/go.bbclass +++ b/meta/classes/go.bbclass | |||
@@ -71,17 +71,13 @@ python go_do_unpack() { | |||
71 | if len(src_uri) == 0: | 71 | if len(src_uri) == 0: |
72 | return | 72 | return |
73 | 73 | ||
74 | try: | 74 | fetcher = bb.fetch2.Fetch(src_uri, d) |
75 | fetcher = bb.fetch2.Fetch(src_uri, d) | 75 | for url in fetcher.urls: |
76 | for url in fetcher.urls: | 76 | if fetcher.ud[url].type == 'git': |
77 | if fetcher.ud[url].type == 'git': | 77 | if fetcher.ud[url].parm.get('destsuffix') is None: |
78 | if fetcher.ud[url].parm.get('destsuffix') is None: | 78 | s_dirname = os.path.basename(d.getVar('S')) |
79 | s_dirname = os.path.basename(d.getVar('S')) | 79 | fetcher.ud[url].parm['destsuffix'] = os.path.join(s_dirname, 'src', d.getVar('GO_IMPORT')) + '/' |
80 | fetcher.ud[url].parm['destsuffix'] = os.path.join(s_dirname, 'src', | 80 | fetcher.unpack(d.getVar('WORKDIR')) |
81 | d.getVar('GO_IMPORT')) + '/' | ||
82 | fetcher.unpack(d.getVar('WORKDIR')) | ||
83 | except bb.fetch2.BBFetchException as e: | ||
84 | raise bb.build.FuncFailed(e) | ||
85 | } | 81 | } |
86 | 82 | ||
87 | go_list_packages() { | 83 | go_list_packages() { |
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 682858dc95..7fa4ff20bd 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass | |||
@@ -305,11 +305,8 @@ fakeroot python do_image_qa () { | |||
305 | bb.build.exec_func(cmd, d) | 305 | bb.build.exec_func(cmd, d) |
306 | except oe.utils.ImageQAFailed as e: | 306 | except oe.utils.ImageQAFailed as e: |
307 | qamsg = qamsg + '\tImage QA function %s failed: %s\n' % (e.name, e.description) | 307 | qamsg = qamsg + '\tImage QA function %s failed: %s\n' % (e.name, e.description) |
308 | except bb.build.FuncFailed as e: | 308 | except Exception as e: |
309 | qamsg = qamsg + '\tImage QA function %s failed' % e.name | 309 | qamsg = qamsg + '\tImage QA function %s failed\n' % cmd |
310 | if e.logfile: | ||
311 | qamsg = qamsg + ' (log file is located at %s)' % e.logfile | ||
312 | qamsg = qamsg + '\n' | ||
313 | 310 | ||
314 | if qamsg: | 311 | if qamsg: |
315 | imgname = d.getVar('IMAGE_NAME') | 312 | imgname = d.getVar('IMAGE_NAME') |