summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2017-08-24 00:10:28 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-23 13:48:50 +0100
commit2f9f417de863c580c9037a4a981ef4b67701748b (patch)
tree41f5b0a57aaaccebfd1661e47e93064d91a721a9 /bitbake/lib
parent859e78cbc719c39cdbbfa77fbaaaa715ed39d864 (diff)
downloadpoky-2f9f417de863c580c9037a4a981ef4b67701748b.tar.gz
bitbake: fetch2: don't mandate path element in encodeurl()
URLs do not have to have a path; currently our npm URLs don't, so encodeurl() needs to handle if the path element isn't specified. This fixes errors using OpenEmbedded's devtool add / recipetool create on an npm URL after OE-Core revision ecca596b75cfda2f798a0bdde75f4f774e23a95b that uses decodeurl() and encodeurl() to change URL parameter values. (Bitbake rev: d5cab2dbf5682d2fd08e58316a3bf39a10f63df2) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 7afb2aeb73..3eb0e4d211 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -411,8 +411,6 @@ def encodeurl(decoded):
411 411
412 type, host, path, user, pswd, p = decoded 412 type, host, path, user, pswd, p = decoded
413 413
414 if not path:
415 raise MissingParameterError('path', "encoded from the data %s" % str(decoded))
416 if not type: 414 if not type:
417 raise MissingParameterError('type', "encoded from the data %s" % str(decoded)) 415 raise MissingParameterError('type', "encoded from the data %s" % str(decoded))
418 url = '%s://' % type 416 url = '%s://' % type
@@ -423,10 +421,11 @@ def encodeurl(decoded):
423 url += "@" 421 url += "@"
424 if host and type != "file": 422 if host and type != "file":
425 url += "%s" % host 423 url += "%s" % host
426 # Standardise path to ensure comparisons work 424 if path:
427 while '//' in path: 425 # Standardise path to ensure comparisons work
428 path = path.replace("//", "/") 426 while '//' in path:
429 url += "%s" % urllib.parse.quote(path) 427 path = path.replace("//", "/")
428 url += "%s" % urllib.parse.quote(path)
430 if p: 429 if p:
431 for parm in p: 430 for parm in p:
432 url += ";%s=%s" % (parm, p[parm]) 431 url += ";%s=%s" % (parm, p[parm])