summaryrefslogtreecommitdiffstats
path: root/meta/classes/sstate.bbclass
diff options
context:
space:
mode:
authorZhai Edwin <edwin.zhai@intel.com>2011-02-11 21:55:07 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-11 14:07:49 +0000
commit49a18f1748d2417958b8e19cdd58c0c79f4fc728 (patch)
treeca91e160ea19361f11c0835a95d4433440103fff /meta/classes/sstate.bbclass
parent05d8b6422dc3154b2890f8db3f919faec4457d6f (diff)
downloadpoky-49a18f1748d2417958b8e19cdd58c0c79f4fc728.tar.gz
sstate: Fix bugs after new fetcher
Current sstate's fetch code doesn't reflect latest fetcher changes, so old fetch style cause exception and fail silently. [BUGID #708] got fixed. Another issue is "import xxx" in python function from sstate.bbclass can only sit in the head of the function, else have UnboundLocalError: "local variable XXX referenced before assignment". Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
Diffstat (limited to 'meta/classes/sstate.bbclass')
-rw-r--r--meta/classes/sstate.bbclass6
1 files changed, 3 insertions, 3 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index e4564e4b07..4f1bc39e7a 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -326,13 +326,13 @@ def sstate_package(ss, d):
326 return 326 return
327 327
328def pstaging_fetch(sstatepkg, d): 328def pstaging_fetch(sstatepkg, d):
329 import bb.fetch2
329 330
330 # Only try and fetch if the user has configured a mirror 331 # Only try and fetch if the user has configured a mirror
331 mirrors = bb.data.getVar('SSTATE_MIRRORS', d, True) 332 mirrors = bb.data.getVar('SSTATE_MIRRORS', d, True)
332 if not mirrors: 333 if not mirrors:
333 return 334 return
334 335
335 import bb.fetch2
336 # Copy the data object and override DL_DIR and SRC_URI 336 # Copy the data object and override DL_DIR and SRC_URI
337 localdata = bb.data.createCopy(d) 337 localdata = bb.data.createCopy(d)
338 bb.data.update_data(localdata) 338 bb.data.update_data(localdata)
@@ -453,8 +453,8 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d):
453 #bb.note(str(srcuri)) 453 #bb.note(str(srcuri))
454 454
455 try: 455 try:
456 bb.fetch.init(srcuri.split(), localdata) 456 fetcher = bb.fetch2.Fetch(srcuri.split(), localdata)
457 bb.fetch.checkstatus(localdata, srcuri.split()) 457 fetcher.checkstatus()
458 ret.append(task) 458 ret.append(task)
459 except: 459 except:
460 pass 460 pass