All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] fetch2: don't mandate path element in encodeurl()
@ 2017-08-23 12:10 Paul Eggleton
  2017-08-23 12:10 ` [PATCH 1/1] " Paul Eggleton
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Eggleton @ 2017-08-23 12:10 UTC (permalink / raw)
  To: bitbake-devel

The following changes since commit 27ca94c33234f0ef9753f8285213dde2871a3fcf:

  bitbake: ui: Sort 'Dependent tasks' in taskexp (2017-08-23 12:07:38 +0100)

are available in the git repository at:

  git://git.openembedded.org/bitbake-contrib paule/fetch2-encodeurl-fix
  http://cgit.openembedded.org/bitbake-contrib/log/?h=paule/fetch2-encodeurl-fix

Paul Eggleton (1):
  fetch2: don't mandate path element in encodeurl()

 lib/bb/fetch2/__init__.py | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

-- 
2.9.5



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] fetch2: don't mandate path element in encodeurl()
  2017-08-23 12:10 [PATCH 0/1] fetch2: don't mandate path element in encodeurl() Paul Eggleton
@ 2017-08-23 12:10 ` Paul Eggleton
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggleton @ 2017-08-23 12:10 UTC (permalink / raw)
  To: bitbake-devel

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@linux.intel.com>
---
 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])
-- 
2.9.5



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-23 12:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-23 12:10 [PATCH 0/1] fetch2: don't mandate path element in encodeurl() Paul Eggleton
2017-08-23 12:10 ` [PATCH 1/1] " Paul Eggleton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.