summaryrefslogtreecommitdiff
path: root/meta/classes/utility-tasks.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-07 10:16:00 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-07 10:16:00 +0000
commitfbebb9a9cd80dec2a9fa1812d213ff4fddd19581 (patch)
tree0871029dfa8056ad71775395782ef9e48b4e2441 /meta/classes/utility-tasks.bbclass
parent681bcf4e6b606dde2029d143805023a927285917 (diff)
downloadopenembedded-core-fbebb9a9cd80dec2a9fa1812d213ff4fddd19581.tar.gz
openembedded-core-fbebb9a9cd80dec2a9fa1812d213ff4fddd19581.tar.bz2
openembedded-core-fbebb9a9cd80dec2a9fa1812d213ff4fddd19581.zip
utility-tasks: Update checkuri to new fetcher API
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/utility-tasks.bbclass')
-rw-r--r--meta/classes/utility-tasks.bbclass31
1 files changed, 8 insertions, 23 deletions
diff --git a/meta/classes/utility-tasks.bbclass b/meta/classes/utility-tasks.bbclass
index db22973402..aeac2bce40 100644
--- a/meta/classes/utility-tasks.bbclass
+++ b/meta/classes/utility-tasks.bbclass
@@ -50,33 +50,18 @@ python do_rebuild() {
addtask checkuri
do_checkuri[nostamp] = "1"
python do_checkuri() {
- import sys
+ src_uri = (bb.data.getVar('SRC_URI', d, True) or "").split()
+ if len(src_uri) == 0:
+ return
localdata = bb.data.createCopy(d)
bb.data.update_data(localdata)
- src_uri = bb.data.getVar('SRC_URI', localdata, 1)
-
- try:
- bb.fetch.init(src_uri.split(),d)
- except bb.fetch.NoMethodError:
- (type, value, traceback) = sys.exc_info()
- raise bb.build.FuncFailed("No method: %s" % value)
-
- try:
- bb.fetch.checkstatus(localdata)
- except bb.fetch.MissingParameterError:
- (type, value, traceback) = sys.exc_info()
- raise bb.build.FuncFailed("Missing parameters: %s" % value)
- except bb.fetch.FetchError:
- (type, value, traceback) = sys.exc_info()
- raise bb.build.FuncFailed("Fetch failed: %s" % value)
- except bb.fetch.MD5SumError:
- (type, value, traceback) = sys.exc_info()
- raise bb.build.FuncFailed("MD5 failed: %s" % value)
- except:
- (type, value, traceback) = sys.exc_info()
- raise bb.build.FuncFailed("Unknown fetch Error: %s" % value)
+ try:
+ fetcher = bb.fetch2.Fetch(src_uri, localdata)
+ fetcher.checkstatus()
+ except bb.fetch2.BBFetchException, e:
+ raise bb.build.FuncFailed(e)
}
addtask checkuriall after do_checkuri