[oe-commits] [openembedded-core] 06/07: kernel-yocto.bbclass: fix "referenced before assignment" error

git at git.openembedded.org git at git.openembedded.org
Thu Sep 27 22:42:22 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 9602c03e8701c972f544001415efa92877622f57
Author: Max Kellermann <max.kellermann at gmail.com>
AuthorDate: Mon Sep 24 10:05:55 2018 +0200

    kernel-yocto.bbclass: fix "referenced before assignment" error
    
    If "scc --configs" fails, do_kernel_configcheck() crashes like this:
    
          0338:    try:
          0339:        configs = subprocess.check_output(['scc', '--configs', '-o', s + '/.kernel-meta'], env=env).decode('utf-8')
          0340:    except subprocess.CalledProcessError:
      *** 0341:        bb.fatal( "Cannot gather config fragments for audit: %s" % configs)
          0342:
          0343:    try:
          0344:        subprocess.check_call(['kconf_check', '--report', '-o',
          0345:                '%s/%s/cfg' % (s, kmeta), d.getVar('B') + '/.config', s, configs], cwd=s, env=env)
     Exception: UnboundLocalError: local variable 'configs' referenced before assignment
    
    This crash bug was introduced by commit
    21de5cc43cfedc703e5bc0515507a6dae36afb74
    
    Signed-off-by: Max Kellermann <max.kellermann at gmail.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/kernel-yocto.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index 2ecd060..496c8a7 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -337,8 +337,8 @@ python do_kernel_configcheck() {
 
     try:
         configs = subprocess.check_output(['scc', '--configs', '-o', s + '/.kernel-meta'], env=env).decode('utf-8')
-    except subprocess.CalledProcessError:
-        bb.fatal( "Cannot gather config fragments for audit: %s" % configs)
+    except subprocess.CalledProcessError as e:
+        bb.fatal( "Cannot gather config fragments for audit: %s" % e.output.decode("utf-8") )
 
     try:
         subprocess.check_call(['kconf_check', '--report', '-o',

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list