diff options
author | Mark Hatle <mark.hatle@windriver.com> | 2019-01-23 10:28:18 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-01-24 17:45:49 +0000 |
commit | 1979d9162a335b7d4718a6697ca57bfa16237f0e (patch) | |
tree | 166d38da68350879e5644a9e2ff73392e0381c07 /bitbake/lib/bb/fetch2 | |
parent | 9238a725897e8ec18079c46f80edb9f2248133fc (diff) | |
download | poky-1979d9162a335b7d4718a6697ca57bfa16237f0e.tar.gz |
bitbake: gitsmy.py: Fix unpack of submodules of submodules
If the submodule is in a subdirectory, it needs to have that structure
preserved. This means the unpack path needs to be in the 'dirname' of the
final path -- since the unpack directory name is specified in the URI.
Additional specific test cases were added to ensure this is working properly
based on two recent error reports.
(Bitbake rev: 8c8ecec2a722bc2885e2648d41ac8df07bdf660d)
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2')
-rw-r--r-- | bitbake/lib/bb/fetch2/gitsm.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bitbake/lib/bb/fetch2/gitsm.py b/bitbake/lib/bb/fetch2/gitsm.py index faffb4c77e..f45546b49b 100644 --- a/bitbake/lib/bb/fetch2/gitsm.py +++ b/bitbake/lib/bb/fetch2/gitsm.py | |||
@@ -176,12 +176,11 @@ class GitSM(Git): | |||
176 | 176 | ||
177 | try: | 177 | try: |
178 | newfetch = Fetch([url], d, cache=False) | 178 | newfetch = Fetch([url], d, cache=False) |
179 | newfetch.unpack(root=os.path.join(repo_conf, 'modules')) | 179 | newfetch.unpack(root=os.path.dirname(os.path.join(repo_conf, 'modules', modpath))) |
180 | except Exception as e: | 180 | except Exception as e: |
181 | logger.error('gitsm: submodule unpack failed: %s %s' % (type(e).__name__, str(e))) | 181 | logger.error('gitsm: submodule unpack failed: %s %s' % (type(e).__name__, str(e))) |
182 | raise | 182 | raise |
183 | 183 | ||
184 | newfetch = Fetch([url], d, cache=False) | ||
185 | local_path = newfetch.localpath(url) | 184 | local_path = newfetch.localpath(url) |
186 | 185 | ||
187 | # Correct the submodule references to the local download version... | 186 | # Correct the submodule references to the local download version... |
@@ -191,7 +190,11 @@ class GitSM(Git): | |||
191 | runfetchcmd("%(basecmd)s config submodule.%(module)s.shallow true" % {'basecmd': ud.basecmd, 'module': module}, d, workdir=ud.destdir) | 190 | runfetchcmd("%(basecmd)s config submodule.%(module)s.shallow true" % {'basecmd': ud.basecmd, 'module': module}, d, workdir=ud.destdir) |
192 | 191 | ||
193 | # Ensure the submodule repository is NOT set to bare, since we're checking it out... | 192 | # Ensure the submodule repository is NOT set to bare, since we're checking it out... |
194 | runfetchcmd("%s config core.bare false" % (ud.basecmd), d, quiet=True, workdir=os.path.join(repo_conf, 'modules', modpath)) | 193 | try: |
194 | runfetchcmd("%s config core.bare false" % (ud.basecmd), d, quiet=True, workdir=os.path.join(repo_conf, 'modules', modpath)) | ||
195 | except: | ||
196 | logger.error("Unable to set git config core.bare to false for %s" % os.path.join(repo_conf, 'modules', modpath)) | ||
197 | raise | ||
195 | 198 | ||
196 | Git.unpack(self, ud, destdir, d) | 199 | Git.unpack(self, ud, destdir, d) |
197 | 200 | ||