summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlof Johansson <olof.johansson@axis.com>2013-12-12 17:48:55 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-18 17:08:08 +0000
commit52ef6c210c9bdf245b250934a9d697cf7042b816 (patch)
treef73556859b90581a7a9eb103411c50bff295c948
parent498de0473709414961873333b9473ad5a922d78c (diff)
downloadpoky-52ef6c210c9bdf245b250934a9d697cf7042b816.tar.gz
bitbake: bb.fetch2.git: reuse basecmd attribute
The basecmd is initialized in urldata_init; there's no need redoing that work. (Bitbake rev: f8df6f746fb2e27f029a5449cee6c891b1f36f4f) Signed-off-by: Olof Johansson <olof.johansson@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/fetch2/git.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index c391b38039..bd107dbf21 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -152,7 +152,7 @@ class Git(FetchMethod):
152 return True 152 return True
153 os.chdir(ud.clonedir) 153 os.chdir(ud.clonedir)
154 for name in ud.names: 154 for name in ud.names:
155 if not self._contains_ref(ud.revisions[name], ud.branches[name], d): 155 if not self._contains_ref(ud, d, name):
156 return True 156 return True
157 if ud.write_tarballs and not os.path.exists(ud.fullmirror): 157 if ud.write_tarballs and not os.path.exists(ud.fullmirror):
158 return True 158 return True
@@ -199,7 +199,7 @@ class Git(FetchMethod):
199 # Update the checkout if needed 199 # Update the checkout if needed
200 needupdate = False 200 needupdate = False
201 for name in ud.names: 201 for name in ud.names:
202 if not self._contains_ref(ud.revisions[name], ud.branches[name], d): 202 if not self._contains_ref(ud, d, name):
203 needupdate = True 203 needupdate = True
204 if needupdate: 204 if needupdate:
205 try: 205 try:
@@ -217,7 +217,7 @@ class Git(FetchMethod):
217 ud.repochanged = True 217 ud.repochanged = True
218 os.chdir(ud.clonedir) 218 os.chdir(ud.clonedir)
219 for name in ud.names: 219 for name in ud.names:
220 if not self._contains_ref(ud.revisions[name], ud.branches[name], d): 220 if not self._contains_ref(ud, d, name):
221 raise bb.fetch2.FetchError("Unable to find revision %s in branch %s even from upstream" % (ud.revisions[name], ud.branches[name])) 221 raise bb.fetch2.FetchError("Unable to find revision %s in branch %s even from upstream" % (ud.revisions[name], ud.branches[name]))
222 222
223 def build_mirror_data(self, ud, d): 223 def build_mirror_data(self, ud, d):
@@ -287,9 +287,9 @@ class Git(FetchMethod):
287 def supports_srcrev(self): 287 def supports_srcrev(self):
288 return True 288 return True
289 289
290 def _contains_ref(self, tag, branch, d): 290 def _contains_ref(self, ud, d, name):
291 basecmd = data.getVar("FETCHCMD_git", d, True) or "git" 291 cmd = "%s branch --contains %s --list %s 2> /dev/null | wc -l" % (
292 cmd = "%s branch --contains %s --list %s 2> /dev/null | wc -l" % (basecmd, tag, branch) 292 ud.basecmd, ud.revisions[name], ud.branches[name])
293 try: 293 try:
294 output = runfetchcmd(cmd, d, quiet=True) 294 output = runfetchcmd(cmd, d, quiet=True)
295 except bb.fetch2.FetchError: 295 except bb.fetch2.FetchError:
@@ -313,9 +313,8 @@ class Git(FetchMethod):
313 else: 313 else:
314 username = "" 314 username = ""
315 315
316 basecmd = data.getVar("FETCHCMD_git", d, True) or "git"
317 cmd = "%s ls-remote %s://%s%s%s %s" % \ 316 cmd = "%s ls-remote %s://%s%s%s %s" % \
318 (basecmd, ud.proto, username, ud.host, ud.path, ud.unresolvedrev[name]) 317 (ud.basecmd, ud.proto, username, ud.host, ud.path, ud.unresolvedrev[name])
319 if ud.proto.lower() != 'file': 318 if ud.proto.lower() != 'file':
320 bb.fetch2.check_network_access(d, cmd) 319 bb.fetch2.check_network_access(d, cmd)
321 output = runfetchcmd(cmd, d, True) 320 output = runfetchcmd(cmd, d, True)