]> code.ossystems Code Review - openembedded-core.git/commitdiff
bbclass: bb.fatal() clean up
authorRobert Yang <liezhi.yang@windriver.com>
Wed, 8 May 2013 09:06:46 +0000 (05:06 -0400)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 15 May 2013 21:05:07 +0000 (00:05 +0300)
The bb.fatal() is defined as:

def fatal(*args):
    logger.critical(''.join(args))
    sys.exit(1)

So anything after bb.fatal() in the same code block doesn't have any
effect, e.g.:

    bb.fatal("%s_%s: %s" % (var, pkg, e))
    raise e

The "raise e" should be removed.

I searched all the files which use bb.fatal(), only the following 3
classes have this issues:

  insane.bbclass
  package.bbclass
  package_rpm.bbclass

[YOCTO #4461]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/classes/insane.bbclass
meta/classes/package.bbclass
meta/classes/package_rpm.bbclass

index fb1802223a21374840e0fd65faa80536b8dffc27..3ed558194924303d8b2b5a214630728bd8c20e69 100644 (file)
@@ -718,7 +718,6 @@ def package_qa_check_deps(pkg, pkgdest, skip, d):
             rvar = bb.utils.explode_dep_versions2(localdata.getVar(var, True) or "")
         except ValueError as e:
             bb.fatal("%s_%s: %s" % (var, pkg, e))
-            raise e
         for dep in rvar:
             for v in rvar[dep]:
                 if v and not v.startswith(('< ', '= ', '> ', '<= ', '>=')):
index 0f2743d10668a1c688b4d812be0dfe191592393f..02a14606245c50649525d40eaa3ef6c772ffe840 100644 (file)
@@ -372,7 +372,6 @@ python package_get_auto_pr() {
             auto_pr=prserv_get_pr_auto(d)
         except Exception as e:
             bb.fatal("Can NOT get PRAUTO, exception %s" %  str(e))
-            return
         if auto_pr is None:
             if d.getVar('PRSERV_LOCKDOWN', True):
                 bb.fatal("Can NOT get PRAUTO from lockdown exported file")
index 25b14dd79df54ea44dd01a66c8b3a4dd5753a87f..8935c9fc6a1047e2a7459e9dbfe4e9143ba5903a 100644 (file)
@@ -672,12 +672,10 @@ python write_specfile () {
     pkgdest = d.getVar('PKGDEST', True)
     if not pkgdest:
         bb.fatal("No PKGDEST")
-        return
 
     outspecfile = d.getVar('OUTSPECFILE', True)
     if not outspecfile:
         bb.fatal("No OUTSPECFILE")
-        return
 
     # Construct the SPEC file...
     srcname    = strip_multilib(d.getVar('PN', True), d)