summaryrefslogtreecommitdiffstats
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)
downloadpoky-fbebb9a9cd80dec2a9fa1812d213ff4fddd19581.tar.gz
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() {
50addtask checkuri 50addtask checkuri
51do_checkuri[nostamp] = "1" 51do_checkuri[nostamp] = "1"
52python do_checkuri() { 52python do_checkuri() {
53 import sys 53 src_uri = (bb.data.getVar('SRC_URI', d, True) or "").split()
54 if len(src_uri) == 0:
55 return
54 56
55 localdata = bb.data.createCopy(d) 57 localdata = bb.data.createCopy(d)
56 bb.data.update_data(localdata) 58 bb.data.update_data(localdata)
57 59
58 src_uri = bb.data.getVar('SRC_URI', localdata, 1) 60 try:
59 61 fetcher = bb.fetch2.Fetch(src_uri, localdata)
60 try: 62 fetcher.checkstatus()
61 bb.fetch.init(src_uri.split(),d) 63 except bb.fetch2.BBFetchException, e:
62 except bb.fetch.NoMethodError: 64 raise bb.build.FuncFailed(e)
63 (type, value, traceback) = sys.exc_info()
64 raise bb.build.FuncFailed("No method: %s" % value)
65
66 try:
67 bb.fetch.checkstatus(localdata)
68 except bb.fetch.MissingParameterError:
69 (type, value, traceback) = sys.exc_info()
70 raise bb.build.FuncFailed("Missing parameters: %s" % value)
71 except bb.fetch.FetchError:
72 (type, value, traceback) = sys.exc_info()
73 raise bb.build.FuncFailed("Fetch failed: %s" % value)
74 except bb.fetch.MD5SumError:
75 (type, value, traceback) = sys.exc_info()
76 raise bb.build.FuncFailed("MD5 failed: %s" % value)
77 except:
78 (type, value, traceback) = sys.exc_info()
79 raise bb.build.FuncFailed("Unknown fetch Error: %s" % value)
80} 65}
81 66
82addtask checkuriall after do_checkuri 67addtask checkuriall after do_checkuri