summaryrefslogtreecommitdiffstats
path: root/meta/classes/distrodata.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-07 10:23:01 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-07 10:23:01 +0000
commitaf6480bdde2e2e3709d219f9ca43d7c0938314b6 (patch)
treea94108fda4c7d841ea6c45e24acc57d5e0b44123 /meta/classes/distrodata.bbclass
parentfbebb9a9cd80dec2a9fa1812d213ff4fddd19581 (diff)
downloadpoky-af6480bdde2e2e3709d219f9ca43d7c0938314b6.tar.gz
distrodata: Update to new fetcher API
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/distrodata.bbclass')
-rw-r--r--meta/classes/distrodata.bbclass59
1 files changed, 24 insertions, 35 deletions
diff --git a/meta/classes/distrodata.bbclass b/meta/classes/distrodata.bbclass
index 868f65685b..31e7420cf4 100644
--- a/meta/classes/distrodata.bbclass
+++ b/meta/classes/distrodata.bbclass
@@ -309,42 +309,31 @@ python do_checkpkg() {
309 """ 309 """
310 def internal_fetch_wget(url, d, tmpf): 310 def internal_fetch_wget(url, d, tmpf):
311 status = "ErrFetchUnknown" 311 status = "ErrFetchUnknown"
312 try: 312 """
313 """ 313 Clear internal url cache as it's a temporary check. Not doing so will have
314 Clear internal url cache as it's a temporary check. Not doing so will have 314 bitbake check url multiple times when looping through a single url
315 bitbake check url multiple times when looping through a single url 315 """
316 """ 316 fn = bb.data.getVar('FILE', d, 1)
317 fn = bb.data.getVar('FILE', d, 1) 317 bb.fetch2.urldata_cache[fn] = {}
318 bb.fetch.urldata_cache[fn] = {} 318
319 bb.fetch.init([url], d) 319 """
320 except bb.fetch.NoMethodError: 320 To avoid impacting bitbake build engine, this trick is required for reusing bitbake
321 status = "ErrFetchNoMethod" 321 interfaces. bb.fetch.go() is not appliable as it checks downloaded content in ${DL_DIR}
322 except: 322 while we don't want to pollute that place. So bb.fetch2.checkstatus() is borrowed here
323 status = "ErrInitUrlUnknown" 323 which is designed for check purpose but we override check command for our own purpose
324 else: 324 """
325 """ 325 ld = bb.data.createCopy(d)
326 To avoid impacting bitbake build engine, this trick is required for reusing bitbake 326 bb.data.setVar('CHECKCOMMAND_wget', "/usr/bin/env wget -t 1 --passive-ftp -O %s --user-agent=\"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12) Gecko/20101027 Ubuntu/9.10 (karmic) Firefox/3.6.12\" '${URI}'" \
327 interfaces. bb.fetch.go() is not appliable as it checks downloaded content in ${DL_DIR}
328 while we don't want to pollute that place. So bb.fetch.checkstatus() is borrowed here
329 which is designed for check purpose but we override check command for our own purpose
330 """
331 ld = bb.data.createCopy(d)
332 bb.data.setVar('CHECKCOMMAND_wget', "/usr/bin/env wget -t 1 --passive-ftp -O %s --user-agent=\"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12) Gecko/20101027 Ubuntu/9.10 (karmic) Firefox/3.6.12\" '${URI}'" \
333 % tmpf.name, d) 327 % tmpf.name, d)
334 bb.data.update_data(ld) 328 bb.data.update_data(ld)
335 329
336 try: 330 try:
337 bb.fetch.checkstatus(ld) 331 fetcher = bb.fetch2.Fetch([url], ld)
338 except bb.fetch.MissingParameterError: 332 fetcher.checkstatus()
339 status = "ErrMissParam" 333 status = "SUCC"
340 except bb.fetch.FetchError: 334 except bb.fetch2.BBFetchException, e:
341 status = "ErrFetch" 335 status = "ErrFetch"
342 except bb.fetch.MD5SumError: 336
343 status = "ErrMD5Sum"
344 except:
345 status = "ErrFetchUnknown"
346 else:
347 status = "SUCC"
348 return status 337 return status
349 338
350 """ 339 """