diff options
author | Richard Purdie <richard@openedhand.com> | 2008-04-27 11:28:34 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2008-04-27 11:28:34 +0000 |
commit | d10b26644bb398fc7d724320312f153861b892bf (patch) | |
tree | 5c1a306f4c2b0872fc86355aa5f1b4b8bc7cb8cf /meta | |
parent | 748039c0e195da2ab3de76ab818a88352921b170 (diff) | |
download | openembedded-core-d10b26644bb398fc7d724320312f153861b892bf.tar.gz openembedded-core-d10b26644bb398fc7d724320312f153861b892bf.tar.bz2 openembedded-core-d10b26644bb398fc7d724320312f153861b892bf.zip |
base.bbclass: Add checkuri/checkuriall tasks to check validity of upstream source URLs
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4353 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/base.bbclass | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index b7459bc996..c8330db465 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass @@ -552,6 +552,45 @@ base_do_fetchall() { : } +addtask checkuri +do_checkuri[nostamp] = "1" +python do_checkuri() { + import sys + + 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) +} + +addtask checkuriall after do_checkuri +do_checkuriall[recrdeptask] = "do_checkuri" +do_checkuriall[nostamp] = "1" +base_do_checkuriall() { + : +} + addtask buildall after do_build do_buildall[recrdeptask] = "do_build" base_do_buildall() { |