summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2010-09-09 17:29:23 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-09-10 18:36:35 +0100
commitc01e8760ba5552e91f3af764c1233c2462494213 (patch)
treedb37ec44fbcc560757daf9251f01fa28b184352f /bitbake
parentdc4d33cf0fb8636ffee63ed9d478173cadb34e54 (diff)
downloadpoky-c01e8760ba5552e91f3af764c1233c2462494213.tar.gz
bitbake/fetch: ensure the go() method completes when not using premirrors
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/fetch/__init__.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py
index d0931ec9c3..e04c3df335 100644
--- a/bitbake/lib/bb/fetch/__init__.py
+++ b/bitbake/lib/bb/fetch/__init__.py
@@ -234,8 +234,12 @@ def go(d, urls = None):
234 for u in urls: 234 for u in urls:
235 ud = urldata[u] 235 ud = urldata[u]
236 m = ud.method 236 m = ud.method
237 premirror_fetch = True
238 localpath = ""
239
237 if ud.localfile: 240 if ud.localfile:
238 if not m.try_premirror(u, ud, d): 241 if not m.try_premirror(u, ud, d):
242 premirror_fetch = False
239 # File already present along with md5 stamp file 243 # File already present along with md5 stamp file
240 # Touch md5 file to show activity 244 # Touch md5 file to show activity
241 try: 245 try:
@@ -243,9 +247,10 @@ def go(d, urls = None):
243 except: 247 except:
244 # Errors aren't fatal here 248 # Errors aren't fatal here
245 pass 249 pass
246 continue 250
247 lf = bb.utils.lockfile(ud.lockfile) 251 lf = bb.utils.lockfile(ud.lockfile)
248 if not m.try_premirror(u, ud, d): 252 if not m.try_premirror(u, ud, d):
253 premirror_fetch = False
249 # If someone else fetched this before we got the lock, 254 # If someone else fetched this before we got the lock,
250 # notice and don't try again 255 # notice and don't try again
251 try: 256 try:
@@ -253,12 +258,11 @@ def go(d, urls = None):
253 except: 258 except:
254 # Errors aren't fatal here 259 # Errors aren't fatal here
255 pass 260 pass
256 bb.utils.unlockfile(lf)
257 continue
258 261
259 # First try fetching uri, u, from PREMIRRORS 262 if premirror_fetch:
260 mirrors = [ i.split() for i in (bb.data.getVar('PREMIRRORS', d, 1) or "").split('\n') if i ] 263 # First try fetching uri, u, from PREMIRRORS
261 localpath = try_mirrors(d, u, mirrors, False, m.forcefetch(u, ud, d)) 264 mirrors = [ i.split() for i in (bb.data.getVar('PREMIRRORS', d, 1) or "").split('\n') if i ]
265 localpath = try_mirrors(d, u, mirrors, False, m.forcefetch(u, ud, d))
262 266
263 # Need to re-test forcefetch() which will return true if our copy is too old 267 # Need to re-test forcefetch() which will return true if our copy is too old
264 if m.forcefetch(u, ud, d) or not localpath: 268 if m.forcefetch(u, ud, d) or not localpath: