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/classes | |
parent | 748039c0e195da2ab3de76ab818a88352921b170 (diff) | |
download | poky-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.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() { | |||
552 | : | 552 | : |
553 | } | 553 | } |
554 | 554 | ||
555 | addtask checkuri | ||
556 | do_checkuri[nostamp] = "1" | ||
557 | python 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 | |||
587 | addtask checkuriall after do_checkuri | ||
588 | do_checkuriall[recrdeptask] = "do_checkuri" | ||
589 | do_checkuriall[nostamp] = "1" | ||
590 | base_do_checkuriall() { | ||
591 | : | ||
592 | } | ||
593 | |||
555 | addtask buildall after do_build | 594 | addtask buildall after do_build |
556 | do_buildall[recrdeptask] = "do_build" | 595 | do_buildall[recrdeptask] = "do_build" |
557 | base_do_buildall() { | 596 | base_do_buildall() { |