All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] yocto-kernel bugfix
@ 2013-07-10 14:11 Tom Zanussi
  2013-07-10 14:11 ` [PATCH 1/1] yocto-kernel: make BBLAYERS parsing more robust Tom Zanussi
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Zanussi @ 2013-07-10 14:11 UTC (permalink / raw)
  To: poky; +Cc: Tom Zanussi

This patchset contains a fix for YOCTO #3746.

Please pull into poky/master.

The following changes since commit a63229917a5708de2d161aba0d67168ce0da6365:

  meta-yocto-bsp: update reference board SRCREVs (2013-07-10 09:45:51 +0100)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib.git tzanussi/bug-3746-fix
  http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=tzanussi/bug-3746-fix

Tom Zanussi (1):
  yocto-kernel: make BBLAYERS parsing more robust

 scripts/lib/bsp/kernel.py | 38 ++++++++++++++++++++++++--------------
 1 file changed, 24 insertions(+), 14 deletions(-)

-- 
1.7.11.4



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] yocto-kernel: make BBLAYERS parsing more robust
  2013-07-10 14:11 [PATCH 0/1] yocto-kernel bugfix Tom Zanussi
@ 2013-07-10 14:11 ` Tom Zanussi
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Zanussi @ 2013-07-10 14:11 UTC (permalink / raw)
  To: poky; +Cc: Tom Zanussi

This allows the BBLAYERS parsing code to handle cases where BBLAYERS
is spread across multiple assignments or all on a single line, within
double or single quotes.

Fixes [YOCTO #3746].

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
---
 scripts/lib/bsp/kernel.py | 38 ++++++++++++++++++++++++--------------
 1 file changed, 24 insertions(+), 14 deletions(-)

diff --git a/scripts/lib/bsp/kernel.py b/scripts/lib/bsp/kernel.py
index c3592a3..1971e90 100644
--- a/scripts/lib/bsp/kernel.py
+++ b/scripts/lib/bsp/kernel.py
@@ -60,14 +60,12 @@ def find_bblayers(scripts_path):
             in_bblayers = True
             quotes = line.strip().count('"')
             if quotes > 1:
-                break
+                in_bblayers = False
             continue
         if in_bblayers:
             bblayers_lines.append(line)
             if line.strip().endswith("\""):
-                break
-            else:
-                continue
+                in_bblayers = False
 
     for i, line in enumerate(bblayers_lines):
         if line.strip().endswith("\\"):
@@ -75,19 +73,31 @@ def find_bblayers(scripts_path):
 
     bblayers_line = " ".join(bblayers_lines)
 
-    start_quote = bblayers_line.find("\"")
-    if start_quote == -1:
-        print "Invalid BBLAYERS found in %s, exiting" % bblayers_conf
-        sys.exit(1)
+    openquote = ''
+    for c in bblayers_line:
+        if c == '\"' or c == '\'':
+            if openquote:
+                if c != openquote:
+                    print "Invalid BBLAYERS found in %s, exiting" % bblayers_conf
+                    sys.exit(1)
+                else:
+                    openquote = ''
+            else:
+                openquote = c
 
-    start_quote += 1
-    end_quote = bblayers_line.find("\"", start_quote)
-    if end_quote == -1:
+    if openquote:
         print "Invalid BBLAYERS found in %s, exiting" % bblayers_conf
         sys.exit(1)
 
-    bblayers_line = bblayers_line[start_quote:end_quote]
-    layers = bblayers_line.split()
+    bblayers_line = bblayers_line.strip().replace('\"', '')
+    bblayers_line = bblayers_line.strip().replace('\'', '')
+
+    raw_layers = bblayers_line.split()
+
+    for layer in raw_layers:
+        if layer == 'BBLAYERS' or '=' in layer:
+            continue
+        layers.append(layer)
 
     f.close()
 
@@ -114,7 +124,7 @@ def find_bsp_layer(scripts_path, machine):
     layers = find_bblayers(scripts_path)
 
     for layer in layers:
-        if machine in layer:
+        if layer.endswith(machine):
             return layer
 
     print "Unable to find the BSP layer for machine %s." % machine
-- 
1.7.11.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-07-10 14:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-10 14:11 [PATCH 0/1] yocto-kernel bugfix Tom Zanussi
2013-07-10 14:11 ` [PATCH 1/1] yocto-kernel: make BBLAYERS parsing more robust Tom Zanussi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.