[gnome-continuous-yocto/gnomeostree-3.28-rocko: 7368/8267] bitbake: fetch2: don't mandate path element in encodeurl()
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 7368/8267] bitbake: fetch2: don't mandate path element in encodeurl()
- Date: Sun, 17 Dec 2017 06:09:01 +0000 (UTC)
commit 2f9f417de863c580c9037a4a981ef4b67701748b
Author: Paul Eggleton <paul eggleton linux intel com>
Date: Thu Aug 24 00:10:28 2017 +1200
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>
bitbake/lib/bb/fetch2/__init__.py | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 7afb2ae..3eb0e4d 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -411,8 +411,6 @@ def encodeurl(decoded):
type, host, path, user, pswd, p = decoded
- if not path:
- raise MissingParameterError('path', "encoded from the data %s" % str(decoded))
if not type:
raise MissingParameterError('type', "encoded from the data %s" % str(decoded))
url = '%s://' % type
@@ -423,10 +421,11 @@ def encodeurl(decoded):
url += "@"
if host and type != "file":
url += "%s" % host
- # Standardise path to ensure comparisons work
- while '//' in path:
- path = path.replace("//", "/")
- url += "%s" % urllib.parse.quote(path)
+ if path:
+ # Standardise path to ensure comparisons work
+ while '//' in path:
+ path = path.replace("//", "/")
+ url += "%s" % urllib.parse.quote(path)
if p:
for parm in p:
url += ";%s=%s" % (parm, p[parm])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]