From 57484d68dff378e4f3bd0d3e40b9db02b029feb4 Mon Sep 17 00:00:00 2001 From: Olof Johansson Date: Mon, 20 Jan 2014 12:03:23 +0100 Subject: bitbake: fetch2.URI: Support URIs with both query strings and params There is a case in meta-intel where a SRC_URI contains both a query string and URI parameter: https://edc.intel.com/Download.aspx?id=6190;downloadfilename=LIN_IEMGD_1_14_GOLD_2443.tgz Python's urlparse thought the URI parameters were part of the query parameter value, but in the bitbake context this is obviously not the case. As bitbake's usage isn't really RFC compliant, we have to extract and remove the URI parameters *before* urlparse sees the URI. (Bitbake rev: c2f27ae4271985b48f957747b6ea372c8699cb49) Signed-off-by: Olof Johansson Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/__init__.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'bitbake/lib/bb/fetch2') diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index d9d193ab12..05999607b9 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py @@ -208,6 +208,10 @@ class URI(object): if not uri: return + # We hijack the URL parameters, since the way bitbake uses + # them are not quite RFC compliant. + uri, param_str = (uri.split(";", 1) + [None])[:2] + urlp = urlparse.urlparse(uri) self.scheme = urlp.scheme @@ -242,17 +246,7 @@ class URI(object): if urlp.password: self.userinfo += ':%s' % urlp.password - # Do support params even for URI schemes that Python's - # urlparse doesn't support params for. - path = '' - param_str = '' - if not urlp.params: - path, param_str = (list(urlp.path.split(";", 1)) + [None])[:2] - else: - path = urlp.path - param_str = urlp.params - - self.path = urllib.unquote(path) + self.path = urllib.unquote(urlp.path) if param_str: self.params = self._param_str_split(param_str, ";") -- cgit v1.2.3-54-g00ecf