summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/git.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/fetch2/git.py')
-rw-r--r--bitbake/lib/bb/fetch2/git.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index a901a44f03..b2366317c8 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -73,7 +73,7 @@ class Git(FetchMethod):
73 def init(self, d): 73 def init(self, d):
74 pass 74 pass
75 75
76 def supports(self, url, ud, d): 76 def supports(self, ud, d):
77 """ 77 """
78 Check to see if a given url can be fetched with git. 78 Check to see if a given url can be fetched with git.
79 """ 79 """
@@ -142,10 +142,10 @@ class Git(FetchMethod):
142 142
143 ud.localfile = ud.clonedir 143 ud.localfile = ud.clonedir
144 144
145 def localpath(self, url, ud, d): 145 def localpath(self, ud, d):
146 return ud.clonedir 146 return ud.clonedir
147 147
148 def need_update(self, u, ud, d): 148 def need_update(self, ud, d):
149 if not os.path.exists(ud.clonedir): 149 if not os.path.exists(ud.clonedir):
150 return True 150 return True
151 os.chdir(ud.clonedir) 151 os.chdir(ud.clonedir)
@@ -156,7 +156,7 @@ class Git(FetchMethod):
156 return True 156 return True
157 return False 157 return False
158 158
159 def try_premirror(self, u, ud, d): 159 def try_premirror(self, ud, d):
160 # If we don't do this, updating an existing checkout with only premirrors 160 # If we don't do this, updating an existing checkout with only premirrors
161 # is not possible 161 # is not possible
162 if d.getVar("BB_FETCH_PREMIRRORONLY", True) is not None: 162 if d.getVar("BB_FETCH_PREMIRRORONLY", True) is not None:
@@ -165,7 +165,7 @@ class Git(FetchMethod):
165 return False 165 return False
166 return True 166 return True
167 167
168 def download(self, loc, ud, d): 168 def download(self, ud, d):
169 """Fetch url""" 169 """Fetch url"""
170 170
171 if ud.user: 171 if ud.user:
@@ -214,7 +214,7 @@ class Git(FetchMethod):
214 runfetchcmd("%s pack-redundant --all | xargs -r rm" % ud.basecmd, d) 214 runfetchcmd("%s pack-redundant --all | xargs -r rm" % ud.basecmd, d)
215 ud.repochanged = True 215 ud.repochanged = True
216 216
217 def build_mirror_data(self, url, ud, d): 217 def build_mirror_data(self, ud, d):
218 # Generate a mirror tarball if needed 218 # Generate a mirror tarball if needed
219 if ud.write_tarballs and (ud.repochanged or not os.path.exists(ud.fullmirror)): 219 if ud.write_tarballs and (ud.repochanged or not os.path.exists(ud.fullmirror)):
220 # it's possible that this symlink points to read-only filesystem with PREMIRROR 220 # it's possible that this symlink points to read-only filesystem with PREMIRROR
@@ -292,13 +292,13 @@ class Git(FetchMethod):
292 raise bb.fetch2.FetchError("The command '%s' gave output with more then 1 line unexpectedly, output: '%s'" % (cmd, output)) 292 raise bb.fetch2.FetchError("The command '%s' gave output with more then 1 line unexpectedly, output: '%s'" % (cmd, output))
293 return output.split()[0] != "0" 293 return output.split()[0] != "0"
294 294
295 def _revision_key(self, url, ud, d, name): 295 def _revision_key(self, ud, d, name):
296 """ 296 """
297 Return a unique key for the url 297 Return a unique key for the url
298 """ 298 """
299 return "git:" + ud.host + ud.path.replace('/', '.') + ud.branches[name] 299 return "git:" + ud.host + ud.path.replace('/', '.') + ud.branches[name]
300 300
301 def _latest_revision(self, url, ud, d, name): 301 def _latest_revision(self, ud, d, name):
302 """ 302 """
303 Compute the HEAD revision for the url 303 Compute the HEAD revision for the url
304 """ 304 """
@@ -314,14 +314,14 @@ class Git(FetchMethod):
314 bb.fetch2.check_network_access(d, cmd) 314 bb.fetch2.check_network_access(d, cmd)
315 output = runfetchcmd(cmd, d, True) 315 output = runfetchcmd(cmd, d, True)
316 if not output: 316 if not output:
317 raise bb.fetch2.FetchError("The command %s gave empty output unexpectedly" % cmd, url) 317 raise bb.fetch2.FetchError("The command %s gave empty output unexpectedly" % cmd, ud.url)
318 return output.split()[0] 318 return output.split()[0]
319 319
320 def _build_revision(self, url, ud, d, name): 320 def _build_revision(self, ud, d, name):
321 return ud.revisions[name] 321 return ud.revisions[name]
322 322
323 def checkstatus(self, uri, ud, d): 323 def checkstatus(self, ud, d):
324 fetchcmd = "%s ls-remote %s" % (ud.basecmd, uri) 324 fetchcmd = "%s ls-remote %s" % (ud.basecmd, ud.url)
325 try: 325 try:
326 runfetchcmd(fetchcmd, d, quiet=True) 326 runfetchcmd(fetchcmd, d, quiet=True)
327 return True 327 return True