From dc164812a26856160d835234ff78abcbc2c60545 Mon Sep 17 00:00:00 2001 From: Stefan Herbrechtsmeier Date: Fri, 5 Sep 2025 08:20:53 +0200 Subject: bitbake: fetch2: gitsm: add parentdir parameter Add a parentdir parameter to pass the destination directory of the submodule parent to the submodule. (Bitbake rev: 707dc112797e598bd9eed13767e21a06d75f1450) Signed-off-by: Stefan Herbrechtsmeier Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/gitsm.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'bitbake') diff --git a/bitbake/lib/bb/fetch2/gitsm.py b/bitbake/lib/bb/fetch2/gitsm.py index d013a09d69..c3e7189a09 100644 --- a/bitbake/lib/bb/fetch2/gitsm.py +++ b/bitbake/lib/bb/fetch2/gitsm.py @@ -127,6 +127,7 @@ class GitSM(Git): url += ";bareclone=1" parentdir = self.destdir(ud, '', d) + url += ";parentdir=%s" % parentdir gitdir = '' if ud.bareclone else '.git' subdir = os.path.join(parentdir, gitdir, 'modules', module) url += ";subdir=%s" % subdir @@ -203,6 +204,9 @@ class GitSM(Git): try: newfetch = Fetch([url], d, cache=False) new_ud = newfetch.ud[url] + parentdir = new_ud.parm['parentdir'] + if not os.path.isabs(parentdir): + parentdir = os.path.join(destdir, parentdir) fulldestdir = self.destdir(new_ud, destdir, d) newfetch.unpack(root=destdir) except Exception as e: @@ -212,10 +216,10 @@ class GitSM(Git): local_path = newfetch.localpath(url) # Correct the submodule references to the local download version... - runfetchcmd("%(basecmd)s config submodule.%(module)s.url %(url)s" % {'basecmd': ud.basecmd, 'module': module, 'url' : local_path}, d, workdir=subdestdir) + runfetchcmd("%(basecmd)s config submodule.%(module)s.url %(url)s" % {'basecmd': ud.basecmd, 'module': module, 'url' : local_path}, d, workdir=parentdir) if ud.shallow: - runfetchcmd("%(basecmd)s config submodule.%(module)s.shallow true" % {'basecmd': ud.basecmd, 'module': module}, d, workdir=subdestdir) + runfetchcmd("%(basecmd)s config submodule.%(module)s.shallow true" % {'basecmd': ud.basecmd, 'module': module}, d, workdir=parentdir) # Ensure the submodule repository is NOT set to bare, since we're checking it out... try: -- cgit v1.2.3-54-g00ecf