[oe-commits] João Henrique Ferreira de Freitas : wic: check if BBLAYERS is valid before use

git at git.openembedded.org git at git.openembedded.org
Tue Jun 10 16:44:18 UTC 2014


Module: openembedded-core.git
Branch: master-next
Commit: a3ee9cc7aebaecfa2223552a2c1865a9337de664
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=a3ee9cc7aebaecfa2223552a2c1865a9337de664

Author: João Henrique Ferreira de Freitas <joaohf at gmail.com>
Date:   Tue Jun  3 22:28:03 2014 -0300

wic: check if BBLAYERS is valid before use

If wic is running as raw mode, it's better to check if BBLAYERS
is valid before inspect it.

No functional changes.

Signed-off-by: João Henrique Ferreira de Freitas <joaohf at gmail.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 scripts/lib/image/engine.py | 7 ++++---
 scripts/lib/mic/plugin.py   | 7 ++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/scripts/lib/image/engine.py b/scripts/lib/image/engine.py
index 3bda1bf..1256236 100644
--- a/scripts/lib/image/engine.py
+++ b/scripts/lib/image/engine.py
@@ -96,9 +96,10 @@ def build_canned_image_list(dl):
     layers_path = get_bitbake_var("BBLAYERS")
     canned_wks_layer_dirs = []
 
-    for layer_path in layers_path.split():
-        path = os.path.join(layer_path, SCRIPTS_CANNED_IMAGE_DIR)
-        canned_wks_layer_dirs.append(path)
+    if layers_path is not None:
+        for layer_path in layers_path.split():
+            path = os.path.join(layer_path, SCRIPTS_CANNED_IMAGE_DIR)
+            canned_wks_layer_dirs.append(path)
 
     path = os.path.join(dl, CANNED_IMAGE_DIR)
     canned_wks_layer_dirs.append(path)
diff --git a/scripts/lib/mic/plugin.py b/scripts/lib/mic/plugin.py
index dec0e5b..585fd6d 100644
--- a/scripts/lib/mic/plugin.py
+++ b/scripts/lib/mic/plugin.py
@@ -53,9 +53,10 @@ class PluginMgr(object):
             self.layers_path = get_bitbake_var("BBLAYERS")
         layer_dirs = []
 
-        for layer_path in self.layers_path.split():
-            path = os.path.join(layer_path, SCRIPTS_PLUGIN_DIR, ptype)
-            layer_dirs.append(path)
+        if self.layers_path is not None:
+            for layer_path in self.layers_path.split():
+                path = os.path.join(layer_path, SCRIPTS_PLUGIN_DIR, ptype)
+                layer_dirs.append(path)
 
         path = os.path.join(dl, ptype)
         layer_dirs.append(path)



More information about the Openembedded-commits mailing list