summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2008-04-27 11:28:34 +0000
committerRichard Purdie <richard@openedhand.com>2008-04-27 11:28:34 +0000
commitd10b26644bb398fc7d724320312f153861b892bf (patch)
tree5c1a306f4c2b0872fc86355aa5f1b4b8bc7cb8cf /meta/classes
parent748039c0e195da2ab3de76ab818a88352921b170 (diff)
downloadpoky-d10b26644bb398fc7d724320312f153861b892bf.tar.gz
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/classes')
-rw-r--r--meta/classes/base.bbclass39
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() {
552 : 552 :
553} 553}
554 554
555addtask checkuri
556do_checkuri[nostamp] = "1"
557python do_checkuri() {
558 import sys
559
560 localdata = bb.data.createCopy(d)
561 bb.data.update_data(localdata)
562
563 src_uri = bb.data.getVar('SRC_URI', localdata, 1)
564
565 try:
566 bb.fetch.init(src_uri.split(),d)
567 except bb.fetch.NoMethodError:
568 (type, value, traceback) = sys.exc_info()
569 raise bb.build.FuncFailed("No method: %s" % value)
570
571 try:
572 bb.fetch.checkstatus(localdata)
573 except bb.fetch.MissingParameterError:
574 (type, value, traceback) = sys.exc_info()
575 raise bb.build.FuncFailed("Missing parameters: %s" % value)
576 except bb.fetch.FetchError:
577 (type, value, traceback) = sys.exc_info()
578 raise bb.build.FuncFailed("Fetch failed: %s" % value)
579 except bb.fetch.MD5SumError:
580 (type, value, traceback) = sys.exc_info()
581 raise bb.build.FuncFailed("MD5 failed: %s" % value)
582 except:
583 (type, value, traceback) = sys.exc_info()
584 raise bb.build.FuncFailed("Unknown fetch Error: %s" % value)
585}
586
587addtask checkuriall after do_checkuri
588do_checkuriall[recrdeptask] = "do_checkuri"
589do_checkuriall[nostamp] = "1"
590base_do_checkuriall() {
591 :
592}
593
555addtask buildall after do_build 594addtask buildall after do_build
556do_buildall[recrdeptask] = "do_build" 595do_buildall[recrdeptask] = "do_build"
557base_do_buildall() { 596base_do_buildall() {