diff options
| author | Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> | 2025-09-05 08:20:53 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-11-07 13:15:34 +0000 |
| commit | dc164812a26856160d835234ff78abcbc2c60545 (patch) | |
| tree | e77ad43b57c1ee11913efdcbe0126c934beecfa6 /bitbake | |
| parent | f87318c16d10af4482e177f20242187a6c0dda14 (diff) | |
| download | poky-dc164812a26856160d835234ff78abcbc2c60545.tar.gz | |
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 <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
| -rw-r--r-- | bitbake/lib/bb/fetch2/gitsm.py | 8 |
1 files changed, 6 insertions, 2 deletions
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): | |||
| 127 | url += ";bareclone=1" | 127 | url += ";bareclone=1" |
| 128 | 128 | ||
| 129 | parentdir = self.destdir(ud, '', d) | 129 | parentdir = self.destdir(ud, '', d) |
| 130 | url += ";parentdir=%s" % parentdir | ||
| 130 | gitdir = '' if ud.bareclone else '.git' | 131 | gitdir = '' if ud.bareclone else '.git' |
| 131 | subdir = os.path.join(parentdir, gitdir, 'modules', module) | 132 | subdir = os.path.join(parentdir, gitdir, 'modules', module) |
| 132 | url += ";subdir=%s" % subdir | 133 | url += ";subdir=%s" % subdir |
| @@ -203,6 +204,9 @@ class GitSM(Git): | |||
| 203 | try: | 204 | try: |
| 204 | newfetch = Fetch([url], d, cache=False) | 205 | newfetch = Fetch([url], d, cache=False) |
| 205 | new_ud = newfetch.ud[url] | 206 | new_ud = newfetch.ud[url] |
| 207 | parentdir = new_ud.parm['parentdir'] | ||
| 208 | if not os.path.isabs(parentdir): | ||
| 209 | parentdir = os.path.join(destdir, parentdir) | ||
| 206 | fulldestdir = self.destdir(new_ud, destdir, d) | 210 | fulldestdir = self.destdir(new_ud, destdir, d) |
| 207 | newfetch.unpack(root=destdir) | 211 | newfetch.unpack(root=destdir) |
| 208 | except Exception as e: | 212 | except Exception as e: |
| @@ -212,10 +216,10 @@ class GitSM(Git): | |||
| 212 | local_path = newfetch.localpath(url) | 216 | local_path = newfetch.localpath(url) |
| 213 | 217 | ||
| 214 | # Correct the submodule references to the local download version... | 218 | # Correct the submodule references to the local download version... |
| 215 | runfetchcmd("%(basecmd)s config submodule.%(module)s.url %(url)s" % {'basecmd': ud.basecmd, 'module': module, 'url' : local_path}, d, workdir=subdestdir) | 219 | runfetchcmd("%(basecmd)s config submodule.%(module)s.url %(url)s" % {'basecmd': ud.basecmd, 'module': module, 'url' : local_path}, d, workdir=parentdir) |
| 216 | 220 | ||
| 217 | if ud.shallow: | 221 | if ud.shallow: |
| 218 | runfetchcmd("%(basecmd)s config submodule.%(module)s.shallow true" % {'basecmd': ud.basecmd, 'module': module}, d, workdir=subdestdir) | 222 | runfetchcmd("%(basecmd)s config submodule.%(module)s.shallow true" % {'basecmd': ud.basecmd, 'module': module}, d, workdir=parentdir) |
| 219 | 223 | ||
| 220 | # Ensure the submodule repository is NOT set to bare, since we're checking it out... | 224 | # Ensure the submodule repository is NOT set to bare, since we're checking it out... |
| 221 | try: | 225 | try: |
