Skip to contentSkip to conversation

Fixes for devtool QA issues on the YP autobuilder

PATCH New Paul Eggleton 1 participant 3 messages Dec 29, 2014

lore
Share & tools
lore
#0 lore raw

cover Fixes for devtool QA issues on the YP autobuilder

These fix the code in bitbake-layers and lib/bb/utils.py that OE's devtool and its QA tests use so that the tests should now pass.

The following changes since commit 10a47b1ec7470c9e8c4ffe0bb35cdf6d1bb2ee2e:

fetch2/wget: Fix horrible temp file handling (2014-12-23 12:35:06 +0000)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib paule/bblayers-fixes
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=paule/bblayers-fixes

Paul Eggleton (2):
bitbake-layers: fix error handling in add-layer / remove-layer
utils: make edit_metadata_file() handle VARIABLE +=

 bin/bitbake-layers |  2 +-
 lib/bb/utils.py    | 10 +++++++++-
 2 files changed, 10 insertions(+), 2 deletions(-)
Signature · 1 line
1.9.3
#1 lore raw

PATCH 1/2 bitbake-layers: fix error handling in add-layer / remove-layer

* Fix add-layer error message when a layer is already in BBLAYERS
* Ensure we show an error message if we can't find BBLAYERS at all

---
 bin/bitbake-layers | 2 +-
 lib/bb/utils.py    | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)
bin/bitbake-layers +1 -1
index edb4d2f..9879498 100755
@@ -130,7 +130,7 @@ usage: add-layer <layerdir>
         (notadded, _) = bb.utils.edit_bblayers_conf(bblayers_conf, layerdir, None)
         if notadded:
             for item in notadded:
-                sys.stderr.write("Specified layer %s not in BBLAYERS\n" % item)
+                sys.stderr.write("Specified layer %s is already in BBLAYERS\n" % item)
 
 
     def do_remove_layer(self, dirname):
lib/bb/utils.py +8 -0
index f26349f..ef8cd4d 100644
@@ -1012,7 +1012,11 @@ def edit_bblayers_conf(bblayers_conf, add, remove):
     addlayers = layerlist_param(add)
     removelayers = layerlist_param(remove)
 
+    # Need to use a list here because we can't set non-local variables from a callback in python 2.x
+    bblayercalls = []
+
     def handle_bblayers(varname, origvalue):
+        bblayercalls.append(varname)
         updated = False
         bblayers = [remove_trailing_sep(x) for x in origvalue.split()]
         if removelayers:
@@ -1040,5 +1044,9 @@ def edit_bblayers_conf(bblayers_conf, add, remove):
             return (origvalue, 2, False)
 
     edit_metadata_file(bblayers_conf, ['BBLAYERS'], handle_bblayers)
+
+    if not bblayercalls:
+        raise Exception('Unable to find BBLAYERS in %s' % bblayers_conf)
+
     return (notadded, notremoved)
 
Signature · 1 line
1.9.3
#2 lore raw

PATCH 2/2 utils: make edit_metadata_file() handle VARIABLE +=

In reply to Paul Eggleton

This is a little crude as the usage basically ignores that you're doing an append operation, but for a lot of cases it will be sufficient.

---
 lib/bb/utils.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/utils.py +1 -1
index ef8cd4d..90090b2 100644
@@ -923,7 +923,7 @@ def edit_metadata_file(meta_file, variables, func):
     """
     var_res = {}
     for var in variables:
-        var_res[var] = re.compile(r'^%s[ \t]*[?=]+' % var)
+        var_res[var] = re.compile(r'^%s[ \t]*[?+]*=' % var)
 
     updated = False
     varset_start = ''
Signature · 1 line
1.9.3