summaryrefslogtreecommitdiff
path: root/meta/classes
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
parentfbebb9a9cd80dec2a9fa1812d213ff4fddd19581 (diff)
downloadopenembedded-core-af6480bdde2e2e3709d219f9ca43d7c0938314b6.tar.gz
openembedded-core-af6480bdde2e2e3709d219f9ca43d7c0938314b6.tar.bz2
openembedded-core-af6480bdde2e2e3709d219f9ca43d7c0938314b6.zip
distrodata: Update to new fetcher API
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-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() {
"""
def internal_fetch_wget(url, d, tmpf):
status = "ErrFetchUnknown"
- try:
- """
- Clear internal url cache as it's a temporary check. Not doing so will have
- bitbake check url multiple times when looping through a single url
- """
- fn = bb.data.getVar('FILE', d, 1)
- bb.fetch.urldata_cache[fn] = {}
- bb.fetch.init([url], d)
- except bb.fetch.NoMethodError:
- status = "ErrFetchNoMethod"
- except:
- status = "ErrInitUrlUnknown"
- else:
- """
- To avoid impacting bitbake build engine, this trick is required for reusing bitbake
- interfaces. bb.fetch.go() is not appliable as it checks downloaded content in ${DL_DIR}
- while we don't want to pollute that place. So bb.fetch.checkstatus() is borrowed here
- which is designed for check purpose but we override check command for our own purpose
- """
- ld = bb.data.createCopy(d)
- 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}'" \
+ """
+ Clear internal url cache as it's a temporary check. Not doing so will have
+ bitbake check url multiple times when looping through a single url
+ """
+ fn = bb.data.getVar('FILE', d, 1)
+ bb.fetch2.urldata_cache[fn] = {}
+
+ """
+ To avoid impacting bitbake build engine, this trick is required for reusing bitbake
+ interfaces. bb.fetch.go() is not appliable as it checks downloaded content in ${DL_DIR}
+ while we don't want to pollute that place. So bb.fetch2.checkstatus() is borrowed here
+ which is designed for check purpose but we override check command for our own purpose
+ """
+ ld = bb.data.createCopy(d)
+ 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}'" \
% tmpf.name, d)
- bb.data.update_data(ld)
-
- try:
- bb.fetch.checkstatus(ld)
- except bb.fetch.MissingParameterError:
- status = "ErrMissParam"
- except bb.fetch.FetchError:
- status = "ErrFetch"
- except bb.fetch.MD5SumError:
- status = "ErrMD5Sum"
- except:
- status = "ErrFetchUnknown"
- else:
- status = "SUCC"
+ bb.data.update_data(ld)
+
+ try:
+ fetcher = bb.fetch2.Fetch([url], ld)
+ fetcher.checkstatus()
+ status = "SUCC"
+ except bb.fetch2.BBFetchException, e:
+ status = "ErrFetch"
+
return status
"""