summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/fetch/__init__.py')
-rw-r--r--bitbake/lib/bb/fetch/__init__.py32
1 files changed, 16 insertions, 16 deletions
diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py
index b1b5eda35b..09c83b0264 100644
--- a/bitbake/lib/bb/fetch/__init__.py
+++ b/bitbake/lib/bb/fetch/__init__.py
@@ -85,7 +85,7 @@ def decodeurl(url):
85 p = {} 85 p = {}
86 if parm: 86 if parm:
87 for s in parm.split(';'): 87 for s in parm.split(';'):
88 s1,s2 = s.split('=') 88 s1, s2 = s.split('=')
89 p[s1] = s2 89 p[s1] = s2
90 90
91 return (type, host, path, user, pswd, p) 91 return (type, host, path, user, pswd, p)
@@ -121,7 +121,7 @@ def uri_replace(uri, uri_find, uri_replace, d):
121 uri_decoded = list(decodeurl(uri)) 121 uri_decoded = list(decodeurl(uri))
122 uri_find_decoded = list(decodeurl(uri_find)) 122 uri_find_decoded = list(decodeurl(uri_find))
123 uri_replace_decoded = list(decodeurl(uri_replace)) 123 uri_replace_decoded = list(decodeurl(uri_replace))
124 result_decoded = ['','','','','',{}] 124 result_decoded = ['', '', '', '', '', {}]
125 for i in uri_find_decoded: 125 for i in uri_find_decoded:
126 loc = uri_find_decoded.index(i) 126 loc = uri_find_decoded.index(i)
127 result_decoded[loc] = uri_decoded[loc] 127 result_decoded[loc] = uri_decoded[loc]
@@ -214,7 +214,7 @@ def init(urls, d, setup = True):
214 if setup: 214 if setup:
215 for url in urldata: 215 for url in urldata:
216 if not urldata[url].setup: 216 if not urldata[url].setup:
217 urldata[url].setup_localpath(d) 217 urldata[url].setup_localpath(d)
218 218
219 urldata_cache[fn] = urldata 219 urldata_cache[fn] = urldata
220 return urldata 220 return urldata
@@ -243,7 +243,7 @@ def go(d, urls = None):
243 continue 243 continue
244 lf = bb.utils.lockfile(ud.lockfile) 244 lf = bb.utils.lockfile(ud.lockfile)
245 if not m.forcefetch(u, ud, d) and os.path.exists(ud.md5): 245 if not m.forcefetch(u, ud, d) and os.path.exists(ud.md5):
246 # If someone else fetched this before we got the lock, 246 # If someone else fetched this before we got the lock,
247 # notice and don't try again 247 # notice and don't try again
248 try: 248 try:
249 os.utime(ud.md5, None) 249 os.utime(ud.md5, None)
@@ -309,7 +309,7 @@ def localpaths(d):
309 urldata = init([], d, True) 309 urldata = init([], d, True)
310 310
311 for u in urldata: 311 for u in urldata:
312 ud = urldata[u] 312 ud = urldata[u]
313 local.append(ud.localpath) 313 local.append(ud.localpath)
314 314
315 return local 315 return local
@@ -321,15 +321,15 @@ def get_srcrev(d):
321 Return the version string for the current package 321 Return the version string for the current package
322 (usually to be used as PV) 322 (usually to be used as PV)
323 Most packages usually only have one SCM so we just pass on the call. 323 Most packages usually only have one SCM so we just pass on the call.
324 In the multi SCM case, we build a value based on SRCREV_FORMAT which must 324 In the multi SCM case, we build a value based on SRCREV_FORMAT which must
325 have been set. 325 have been set.
326 """ 326 """
327 327
328 # 328 #
329 # Ugly code alert. localpath in the fetchers will try to evaluate SRCREV which 329 # Ugly code alert. localpath in the fetchers will try to evaluate SRCREV which
330 # could translate into a call to here. If it does, we need to catch this 330 # could translate into a call to here. If it does, we need to catch this
331 # and provide some way so it knows get_srcrev is active instead of being 331 # and provide some way so it knows get_srcrev is active instead of being
332 # some number etc. hence the srcrev_internal_call tracking and the magic 332 # some number etc. hence the srcrev_internal_call tracking and the magic
333 # "SRCREVINACTION" return value. 333 # "SRCREVINACTION" return value.
334 # 334 #
335 # Neater solutions welcome! 335 # Neater solutions welcome!
@@ -339,7 +339,7 @@ def get_srcrev(d):
339 339
340 scms = [] 340 scms = []
341 341
342 # Only call setup_localpath on URIs which suppports_srcrev() 342 # Only call setup_localpath on URIs which suppports_srcrev()
343 urldata = init(bb.data.getVar('SRC_URI', d, 1).split(), d, False) 343 urldata = init(bb.data.getVar('SRC_URI', d, 1).split(), d, False)
344 for u in urldata: 344 for u in urldata:
345 ud = urldata[u] 345 ud = urldata[u]
@@ -352,7 +352,7 @@ def get_srcrev(d):
352 bb.msg.error(bb.msg.domain.Fetcher, "SRCREV was used yet no valid SCM was found in SRC_URI") 352 bb.msg.error(bb.msg.domain.Fetcher, "SRCREV was used yet no valid SCM was found in SRC_URI")
353 raise ParameterError 353 raise ParameterError
354 354
355 bb.data.setVar('__BB_DONT_CACHE','1', d) 355 bb.data.setVar('__BB_DONT_CACHE', '1', d)
356 356
357 if len(scms) == 1: 357 if len(scms) == 1:
358 return urldata[scms[0]].method.sortable_revision(scms[0], urldata[scms[0]], d) 358 return urldata[scms[0]].method.sortable_revision(scms[0], urldata[scms[0]], d)
@@ -375,7 +375,7 @@ def get_srcrev(d):
375 375
376def localpath(url, d, cache = True): 376def localpath(url, d, cache = True):
377 """ 377 """
378 Called from the parser with cache=False since the cache isn't ready 378 Called from the parser with cache=False since the cache isn't ready
379 at this point. Also called from classed in OE e.g. patch.bbclass 379 at this point. Also called from classed in OE e.g. patch.bbclass
380 """ 380 """
381 ud = init([url], d) 381 ud = init([url], d)
@@ -538,7 +538,7 @@ class Fetch(object):
538 def localpath(self, url, urldata, d): 538 def localpath(self, url, urldata, d):
539 """ 539 """
540 Return the local filename of a given url assuming a successful fetch. 540 Return the local filename of a given url assuming a successful fetch.
541 Can also setup variables in urldata for use in go (saving code duplication 541 Can also setup variables in urldata for use in go (saving code duplication
542 and duplicate code execution) 542 and duplicate code execution)
543 """ 543 """
544 return url 544 return url
@@ -599,8 +599,8 @@ class Fetch(object):
599 """ 599 """
600 Return: 600 Return:
601 a) a source revision if specified 601 a) a source revision if specified
602 b) True if auto srcrev is in action 602 b) True if auto srcrev is in action
603 c) False otherwise 603 c) False otherwise
604 """ 604 """
605 605
606 if 'rev' in ud.parm: 606 if 'rev' in ud.parm:
@@ -632,7 +632,7 @@ class Fetch(object):
632 b) None otherwise 632 b) None otherwise
633 """ 633 """
634 634
635 localcount= None 635 localcount = None
636 if 'name' in ud.parm: 636 if 'name' in ud.parm:
637 pn = data.getVar("PN", d, 1) 637 pn = data.getVar("PN", d, 1)
638 localcount = data.getVar("LOCALCOUNT_" + ud.parm['name'], d, 1) 638 localcount = data.getVar("LOCALCOUNT_" + ud.parm['name'], d, 1)
@@ -685,7 +685,7 @@ class Fetch(object):
685 685
686 def sortable_revision(self, url, ud, d): 686 def sortable_revision(self, url, ud, d):
687 """ 687 """
688 688
689 """ 689 """
690 if hasattr(self, "_sortable_revision"): 690 if hasattr(self, "_sortable_revision"):
691 return self._sortable_revision(url, ud, d) 691 return self._sortable_revision(url, ud, d)