summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/tests
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2018-09-25 13:15:25 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-09-26 15:14:33 +0100
commit5cd00e3e53819f3c10d1733480077ce9f3cc2ca8 (patch)
tree2b0df39dabfafe0465827ec1211c6260d4c5e5d2 /bitbake/lib/bb/tests
parentf61ef5b45417382ff94e9d389d8eeda490026d73 (diff)
downloadpoky-5cd00e3e53819f3c10d1733480077ce9f3cc2ca8.tar.gz
bitbake: fetch2/gitsm.py: Rework the git submodule fetcher
The prior fetcher did not know how to work with MIRRORS, and did not honor BB_NO_NETWORK and similar. The new fetcher approach recursively calls 'gitsm' download on each submodule detected. This ensures that it will go throug the standard download process. Each downloaded submodule is then 'attached' to the original download in the 'modules' directory. This mimics the behavior of: git submodule init but there is no chance it will contact the network without permission. It then corrects upstream reference URIs. The unpack steps simply copies the items from the downloads to the destdir. Once copied the submodules are connected and we then run: git submodule update According to the git documentation, git submodule init can and will modify the project configuration and may connect to the network. Doing the work manually prevents this. (This manual process is allowed based on my reading of the documentation.) See: https://git-scm.com/book/en/v2/Git-Tools-Submodules The small change to the existing test is due to this new code always assuming the code is from a remote system, and not a 'local' repository. If this assumption proves to be incorrect -- code will need to be added to deal with local repositories without an upstream URI. (Bitbake rev: 9c6b39adf9781fa6745f48913a97c859fa37eb5b) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/tests')
-rw-r--r--bitbake/lib/bb/tests/fetch.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py
index e1c856f117..9c5601aa4d 100644
--- a/bitbake/lib/bb/tests/fetch.py
+++ b/bitbake/lib/bb/tests/fetch.py
@@ -1344,6 +1344,9 @@ class GitShallowTest(FetcherTest):
1344 smdir = os.path.join(self.tempdir, 'gitsubmodule') 1344 smdir = os.path.join(self.tempdir, 'gitsubmodule')
1345 bb.utils.mkdirhier(smdir) 1345 bb.utils.mkdirhier(smdir)
1346 self.git('init', cwd=smdir) 1346 self.git('init', cwd=smdir)
1347 # Make this look like it was cloned from a remote...
1348 self.git('config --add remote.origin.url "%s"' % smdir, cwd=smdir)
1349 self.git('config --add remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"', cwd=smdir)
1347 self.add_empty_file('asub', cwd=smdir) 1350 self.add_empty_file('asub', cwd=smdir)
1348 1351
1349 self.git('submodule init', cwd=self.srcdir) 1352 self.git('submodule init', cwd=self.srcdir)