aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2019-03-12 18:46:21 -0400
committerArmin Kuster <akuster@mvista.com>2019-03-13 08:05:19 -0700
commit4660933f83e528766d71eab662cc79dcf17b4be7 (patch)
tree8b323aad0e76b79bbb5d26af811ca00169eb38ef
parent54802438f2f2d73aba3e7fb8d6cce45aa7cffe77 (diff)
downloadbitbake-contrib-4660933f83e528766d71eab662cc79dcf17b4be7.tar.gz
gitsm.py: Optimize code and attempt to resolve locking issue
It was reported that a race condition on a shared download directory could occur with the gitsm fetcher, the result happened with a call to git config that occured within the update_submodules. Since the fetch is locked by the upper level, it was probably the prior need_update(...) function causing this because of some old code. The gitsm class inherits the git class. The need_update was overridding the version in gitsm, so that it forceably checked the submodules. It's clear we can optimize the code by only updating if the primary repository needs updating. Since we don't care if the submodule repository has changed because if the primary hasn't, references to the submodule won't change. Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 346338667edca1f58ace769ad417548da2b8d981) Signed-off-by: Scott Murray <scott.murray@konsulko.com> Signed-off-by: Armin Kuster <akuster@mvista.com>
-rw-r--r--lib/bb/fetch2/gitsm.py14
1 files changed, 0 insertions, 14 deletions
diff --git a/lib/bb/fetch2/gitsm.py b/lib/bb/fetch2/gitsm.py
index dd94186cc..11bfa6684 100644
--- a/lib/bb/fetch2/gitsm.py
+++ b/lib/bb/fetch2/gitsm.py
@@ -148,20 +148,6 @@ class GitSM(Git):
return True
- def need_update(self, ud, d):
- main_repo_needs_update = Git.need_update(self, ud, d)
-
- # First check that the main repository has enough history fetched. If it doesn't, then we don't
- # even have the .gitmodules and gitlinks for the submodules to attempt asking whether the
- # submodules' histories are recent enough.
- if main_repo_needs_update:
- return True
-
- # Now check that the submodule histories are new enough. The git-submodule command doesn't have
- # any clean interface for doing this aside from just attempting the checkout (with network
- # fetched disabled).
- return not self.update_submodules(ud, d)
-
def download(self, ud, d):
Git.download(self, ud, d)