Skip to contentSkip to conversation

Fix parsing after AVAILABLE_LICENSES change

PATCH New Paul Eggleton 1 participant 1 message Jan 6, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix parsing after AVAILABLE_LICENSES change

In OE-Core commit 8c9ef587fe499c612a878a1ab42092eb79b334ef an AVAILABLE_LICENSES variable was added in license.bbclass where its value is assigned with immediate expansion ( := ) with the result that it looks in LICENSE_PATH for licenses; in turn LICENSE_PATH refers to COREBASE. You might assume that COREBASE is always set, and normally it is (since it's set OE-Core's layer.conf) - but in the layer index context we do not parse layer.conf until a bit later, so it immediately fails. The quick way to fix this is just to set our own (correct) value for COREBASE and then AVAILABLE_LICENSES can be expanded successfully.

You might ask why we don't instead just set BBLAYERS such that we *do* parse OE-Core's layer.conf - the answer is that that can have other effects such as BBFILE_COLLECTIONS being set, and at least at the moment the rest of the code isn't expecting that.

Fixes [YOCTO #13723].

---
 layerindex/recipeparse.py | 3 +++
 1 file changed, 3 insertions(+)
layerindex/recipeparse.py +3 -0
index 162cf62c..35867adb 100644
@@ -74,6 +74,9 @@ def init_parser(settings, branch, bitbakepath, enable_tracking=False, nocheckout
     # (see findTopdir() in bitbake/lib/bb/cookerdata.py)
     os.mkdir(os.path.join(tempdir, 'conf'))
     with open(os.path.join(tempdir, 'conf', 'bblayers.conf'), 'w') as f:
+        if not classic:
+            # We need this to avoid problems with AVAILABLE_LICENSES
+            f.write('COREBASE = "%s"\n' % core_repodir)
         pass
 
     if logger:
Signature · 1 line
2.20.1