diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2014-01-22 18:45:42 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-01-28 00:52:34 +0000 |
commit | 8b576acb215b091bd3836aa4fc6022e7e408c420 (patch) | |
tree | 6efc17dedfdf7fa6496ebc9a6ec41d41873d6ccd /meta/classes/sanity.bbclass | |
parent | ffecae7516504eea0e8bd2bdcfa18c3a9f8bb941 (diff) | |
download | poky-8b576acb215b091bd3836aa4fc6022e7e408c420.tar.gz |
sanity.bbclass: check required perl modules
Several required perl modules may missing on the host, for example the
Text::ParseWords, Thread::Queue and Data::Dumper are not installed by
default on recent Fedora releases (19 and 20 AFAIK). There would be wild
errors if they don't exist, so check them in sanity.bbclass.
And add perl to SANITY_REQUIRED_UTILITIES.
[YOCTO #5744]
(From OE-Core rev: b46d82bea23208733b71642bb262c9a05c08efec)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sanity.bbclass')
-rw-r--r-- | meta/classes/sanity.bbclass | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass index 8531df16b0..e5bf970db2 100644 --- a/meta/classes/sanity.bbclass +++ b/meta/classes/sanity.bbclass | |||
@@ -2,7 +2,8 @@ | |||
2 | # Sanity check the users setup for common misconfigurations | 2 | # Sanity check the users setup for common misconfigurations |
3 | # | 3 | # |
4 | 4 | ||
5 | SANITY_REQUIRED_UTILITIES ?= "patch diffstat makeinfo git bzip2 tar gzip gawk chrpath wget cpio" | 5 | SANITY_REQUIRED_UTILITIES ?= "patch diffstat makeinfo git bzip2 tar \ |
6 | gzip gawk chrpath wget cpio perl" | ||
6 | 7 | ||
7 | def bblayers_conf_file(d): | 8 | def bblayers_conf_file(d): |
8 | return os.path.join(d.getVar('TOPDIR', True), 'conf/bblayers.conf') | 9 | return os.path.join(d.getVar('TOPDIR', True), 'conf/bblayers.conf') |
@@ -378,6 +379,17 @@ def check_git_version(sanity_data): | |||
378 | return "Your version of git is older than 1.7.5 and has bugs which will break builds. Please install a newer version of git.\n" | 379 | return "Your version of git is older than 1.7.5 and has bugs which will break builds. Please install a newer version of git.\n" |
379 | return None | 380 | return None |
380 | 381 | ||
382 | # Check the required perl modules which may not be installed by default | ||
383 | def check_perl_modules(sanity_data): | ||
384 | ret = "" | ||
385 | modules = ( "Text::ParseWords", "Thread::Queue", "Data::Dumper" ) | ||
386 | for m in modules: | ||
387 | status, result = oe.utils.getstatusoutput("perl -e 'use %s' 2> /dev/null" % m) | ||
388 | if status != 0: | ||
389 | ret += "%s " % m | ||
390 | if ret: | ||
391 | return "Required perl module(s) not found: %s\n" % ret | ||
392 | return None | ||
381 | 393 | ||
382 | def sanity_check_conffiles(status, d): | 394 | def sanity_check_conffiles(status, d): |
383 | # Check we are using a valid local.conf | 395 | # Check we are using a valid local.conf |
@@ -488,6 +500,7 @@ def check_sanity_version_change(status, d): | |||
488 | status.addresult(check_make_version(d)) | 500 | status.addresult(check_make_version(d)) |
489 | status.addresult(check_tar_version(d)) | 501 | status.addresult(check_tar_version(d)) |
490 | status.addresult(check_git_version(d)) | 502 | status.addresult(check_git_version(d)) |
503 | status.addresult(check_perl_modules(d)) | ||
491 | 504 | ||
492 | missing = "" | 505 | missing = "" |
493 | 506 | ||