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 <paul.eggleton@linux.intel.com>
This commit is contained in:
Paul Eggleton 2018-10-01 16:16:12 +13:00
parent 5568ba0ebf
commit 11a1d0859d

View File

@ -436,6 +436,12 @@ def main():
deps = extract_value('LAYERDEPENDS', output) deps = extract_value('LAYERDEPENDS', output)
recs = extract_value('LAYERRECOMMENDS', 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) deps_dict = utils.explode_dep_versions2(bitbakepath, deps)
recs_dict = utils.explode_dep_versions2(bitbakepath, recs) recs_dict = utils.explode_dep_versions2(bitbakepath, recs)
if not (deps_dict or recs_dict): if not (deps_dict or recs_dict):