[oe-commits] [bitbake] branch master updated: fetch2: don't mandate path element in encodeurl()

git at git.openembedded.org git at git.openembedded.org
Wed Aug 23 12:50:03 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository bitbake.

The following commit(s) were added to refs/heads/master by this push:
     new d5cab2d  fetch2: don't mandate path element in encodeurl()
d5cab2d is described below

commit d5cab2dbf5682d2fd08e58316a3bf39a10f63df2
Author: Paul Eggleton <paul.eggleton at linux.intel.com>
AuthorDate: Thu Aug 24 00:10:28 2017 +1200

    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.
    
    Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/fetch2/__init__.py | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index 7afb2ae..3eb0e4d 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/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])

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list