diff options
-rw-r--r-- | bitbake/lib/bb/fetch2/__init__.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index f571fc45e6..dcada12ead 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py | |||
@@ -56,8 +56,11 @@ class BBFetchException(Exception): | |||
56 | 56 | ||
57 | class MalformedUrl(BBFetchException): | 57 | class MalformedUrl(BBFetchException): |
58 | """Exception raised when encountering an invalid url""" | 58 | """Exception raised when encountering an invalid url""" |
59 | def __init__(self, url): | 59 | def __init__(self, url, message=''): |
60 | msg = "The URL: '%s' is invalid and cannot be interpreted" % url | 60 | if message: |
61 | msg = message | ||
62 | else: | ||
63 | msg = "The URL: '%s' is invalid and cannot be interpreted" % url | ||
61 | self.url = url | 64 | self.url = url |
62 | BBFetchException.__init__(self, msg) | 65 | BBFetchException.__init__(self, msg) |
63 | self.args = (url,) | 66 | self.args = (url,) |
@@ -371,8 +374,11 @@ def decodeurl(url): | |||
371 | p = {} | 374 | p = {} |
372 | if parm: | 375 | if parm: |
373 | for s in parm.split(';'): | 376 | for s in parm.split(';'): |
374 | s1, s2 = s.split('=') | 377 | if s: |
375 | p[s1] = s2 | 378 | if not '=' in s: |
379 | raise MalformedUrl(url, "The URL: '%s' is invalid: parameter %s does not specify a value (missing '=')" % (url, s)) | ||
380 | s1, s2 = s.split('=') | ||
381 | p[s1] = s2 | ||
376 | 382 | ||
377 | return type, host, urllib.unquote(path), user, pswd, p | 383 | return type, host, urllib.unquote(path), user, pswd, p |
378 | 384 | ||