From 5c3d2ccf54ddd216e18d807c50331017ed77fe63 Mon Sep 17 00:00:00 2001 From: Paul Barker Date: Fri, 12 Jun 2020 20:15:21 +0100 Subject: bitbake: fetch2/gitsm: Mark srcrev as fetched once all submodules are processed This prevents multiple bitbake.srcrev entries being created when a repository has more than one submodule. It also ensures that the bitbake.srcrev entry is not added unless all submodules are correctly fetched. (Bitbake rev: 860ff1193fe53f04696d41635a720c2d1f29fa7f) Signed-off-by: Paul Barker Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/gitsm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bitbake/lib/bb/fetch2/gitsm.py b/bitbake/lib/bb/fetch2/gitsm.py index 56bd5f0480..175dee05c0 100644 --- a/bitbake/lib/bb/fetch2/gitsm.py +++ b/bitbake/lib/bb/fetch2/gitsm.py @@ -163,9 +163,6 @@ class GitSM(Git): try: newfetch = Fetch([url], d, cache=False) newfetch.download() - # Drop a nugget to add each of the srcrevs we've fetched (used by need_update) - runfetchcmd("%s config --add bitbake.srcrev %s" % \ - (ud.basecmd, ud.revisions[ud.names[0]]), d, workdir=workdir) except Exception as e: logger.error('gitsm: submodule download failed: %s %s' % (type(e).__name__, str(e))) raise @@ -181,6 +178,9 @@ class GitSM(Git): shutil.rmtree(tmpdir) else: self.process_submodules(ud, ud.clonedir, download_submodule, d) + # Drop a nugget for the srcrev we've fetched (used by need_update) + runfetchcmd("%s config --add bitbake.srcrev %s" % \ + (ud.basecmd, ud.revisions[ud.names[0]]), d, workdir=ud.clonedir) def unpack(self, ud, destdir, d): def unpack_submodules(ud, url, module, modpath, workdir, d): -- cgit v1.2.3-54-g00ecf