From 11a1d0859d8a72af6f6b9d2b936fa99fe711992e Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Mon, 1 Oct 2018 16:16:12 +1300 Subject: [PATCH] update: fix commands.getstatusoutput errors when parsing python2 branch If you update a python2-based branch then the python2-compatible version of bitbake will be checked out, but we are calling into bitbake's bb.utils directly here from python 3 and thus you get an error about commands.getstatusoutput being missing (since that is not available in python 3 and the old version of bitbake refers to it). To fix this, check out origin/master in the bitbake repo right before we call the code in question. Signed-off-by: Paul Eggleton --- layerindex/update.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/layerindex/update.py b/layerindex/update.py index 983216d..0b0f480 100755 --- a/layerindex/update.py +++ b/layerindex/update.py @@ -436,6 +436,12 @@ def main(): deps = extract_value('LAYERDEPENDS', output) recs = extract_value('LAYERRECOMMENDS', output) + if not options.nocheckout: + # We need to check this out because we're using stuff from bb.utils + # below, and if we don't it might be a python 2 revision which would + # be an issue + utils.checkout_repo(bitbakepath, 'origin/master', logger=logger) + deps_dict = utils.explode_dep_versions2(bitbakepath, deps) recs_dict = utils.explode_dep_versions2(bitbakepath, recs) if not (deps_dict or recs_dict):