diff options
Diffstat (limited to 'bitbake/lib/bb/fetch2/gitsm.py')
| -rw-r--r-- | bitbake/lib/bb/fetch2/gitsm.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/bitbake/lib/bb/fetch2/gitsm.py b/bitbake/lib/bb/fetch2/gitsm.py index e7083001da..56bd5f0480 100644 --- a/bitbake/lib/bb/fetch2/gitsm.py +++ b/bitbake/lib/bb/fetch2/gitsm.py | |||
| @@ -223,3 +223,24 @@ class GitSM(Git): | |||
| 223 | # up the configuration and checks out the files. The main project config should remain | 223 | # up the configuration and checks out the files. The main project config should remain |
| 224 | # unmodified, and no download from the internet should occur. | 224 | # unmodified, and no download from the internet should occur. |
| 225 | runfetchcmd("%s submodule update --recursive --no-fetch" % (ud.basecmd), d, quiet=True, workdir=ud.destdir) | 225 | runfetchcmd("%s submodule update --recursive --no-fetch" % (ud.basecmd), d, quiet=True, workdir=ud.destdir) |
| 226 | |||
| 227 | def implicit_urldata(self, ud, d): | ||
| 228 | import shutil, subprocess, tempfile | ||
| 229 | |||
| 230 | urldata = [] | ||
| 231 | def add_submodule(ud, url, module, modpath, workdir, d): | ||
| 232 | url += ";bareclone=1;nobranch=1" | ||
| 233 | newfetch = Fetch([url], d, cache=False) | ||
| 234 | urldata.extend(newfetch.expanded_urldata()) | ||
| 235 | |||
| 236 | # If we're using a shallow mirror tarball it needs to be unpacked | ||
| 237 | # temporarily so that we can examine the .gitmodules file | ||
| 238 | if ud.shallow and os.path.exists(ud.fullshallow) and ud.method.need_update(ud, d): | ||
| 239 | tmpdir = tempfile.mkdtemp(dir=d.getVar("DL_DIR")) | ||
| 240 | subprocess.check_call("tar -xzf %s" % ud.fullshallow, cwd=tmpdir, shell=True) | ||
| 241 | self.process_submodules(ud, tmpdir, add_submodule, d) | ||
| 242 | shutil.rmtree(tmpdir) | ||
| 243 | else: | ||
| 244 | self.process_submodules(ud, ud.clonedir, add_submodule, d) | ||
| 245 | |||
| 246 | return urldata | ||
