Skip to contentSkip to conversation

utils: only add layer once in edit_bblayers_conf()

PATCH In review Markus Lehtonen 2 participants 2 messages Sep 24, 2015 – Sep 25, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 utils: only add layer once in edit_bblayers_conf()

Prevent edit_bblayers_conf() from adding layer(s) multiple times. This happened when BBLAYERS variable was "listed" multiple times in bblayer.conf - i.e. the configuration was split into multiple separate assignments.

[YOCTO #8316]

---
 lib/bb/utils.py | 1 +
 1 file changed, 1 insertion(+)
lib/bb/utils.py +1 -0
index 91faa49..9b550ef 100644
@@ -1249,6 +1249,7 @@ def edit_bblayers_conf(bblayers_conf, add, remove):
                     bblayers.append(addlayer)
                 else:
                     notadded.append(addlayer)
+            del addlayers[:]
 
         if updated:
             return (bblayers, None, 2, False)
Signature · 1 line
2.1.4
Acked-by on v1 1/1
#1 lore raw
Quoted 17 lines · On Thursday 24 September 2015 16:02:23 Markus Lehtonen wrote:

Prevent edit_bblayers_conf() from adding layer(s) multiple times. This happened when BBLAYERS variable was "listed" multiple times in bblayer.conf - i.e. the configuration was split into multiple separate assignments.

[YOCTO #8316]

---
 lib/bb/utils.py | 1 +
 1 file changed, 1 insertion(+)
lib/bb/utils.py +0 -0
index 91faa49..9b550ef 100644

lib/bb/utils.py def edit_bblayers_conf(bblayers_conf, add, remove): · line 1255

Quoted 7 lines
lib/bb/utils.py +1 -0
@@ -1249,6 +1249,7 @@ def edit_bblayers_conf(bblayers_conf, add, remove):
                     bblayers.append(addlayer)
                 else:
                     notadded.append(addlayer)
+            del addlayers[:]
 
         if updated:
             return (bblayers, None, 2, False)

Nice, a much simpler fix than I'd immediately assumed it would be when I read the bug :)

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre