summaryrefslogtreecommitdiffstats
path: root/meta/classes/license.bbclass
diff options
context:
space:
mode:
authorPhil Blundell <pb@pbcl.net>2013-11-12 13:29:24 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-11-12 16:00:30 +0000
commit790b75f985f8152964402608559a455a8112eefb (patch)
tree094dec494e0b3da598d412cfb74cac3daf1f302a /meta/classes/license.bbclass
parent3635f1fe3bc4f8caea66f8697b62b023ff71948d (diff)
downloadpoky-790b75f985f8152964402608559a455a8112eefb.tar.gz
insane, license: Trap MalformedUrl exceptions when parsing LIC_FILES_CHKSUM
bb.fetch.decodeurl() will throw if it doesn't like the look of the URL that it's given. (Bitbake's idea of what constitutes a valid URL is somewhat idiosyncratic so it is fairly easy to trip over this by mistake when writing a recipe.) If these exceptions are allowed to propagate all the way up to better_exec() then we will get a large amount of python stack trace spew when they are finally caught. Avoid that by catching them locally and throwing bb.build.FuncFailed() with a suitable explanation instead. (From OE-Core rev: ef35e164c62d89806367b822e3baeff482ec237f) Signed-off-by: Phil Blundell <philb@gnu.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/license.bbclass')
-rw-r--r--meta/classes/license.bbclass5
1 files changed, 4 insertions, 1 deletions
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index 6abdae4e84..1c1b679fac 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -228,7 +228,10 @@ def find_license_files(d):
228 return lic_files_paths 228 return lic_files_paths
229 229
230 for url in lic_files.split(): 230 for url in lic_files.split():
231 (type, host, path, user, pswd, parm) = bb.fetch.decodeurl(url) 231 try:
232 (type, host, path, user, pswd, parm) = bb.fetch.decodeurl(url)
233 except bb.fetch.MalformedUrl:
234 raise bb.build.FuncFailed("%s: LIC_FILES_CHKSUM contains an invalid URL: %s" % (d.getVar('PF', True), url))
232 # We want the license filename and path 235 # We want the license filename and path
233 srclicfile = os.path.join(srcdir, path) 236 srclicfile = os.path.join(srcdir, path)
234 lic_files_paths.append((os.path.basename(path), srclicfile)) 237 lic_files_paths.append((os.path.basename(path), srclicfile))