[bitbake-devel] [PATCH 2/2] bitbake: diff path:file and network include special @ character

Li Wang li.wang at windriver.com
Tue Jun 25 06:31:15 UTC 2013


[YOCTO #4772]

When fetch file, We need to handle the follow address format:
xxx at www.xxx.com:/a/b at c/d
the user name is invalide, when it includes '/' character.
So, we can separate '@' character in username:password, or path:file

Signed-off-by: Li Wang <li.wang at windriver.com>
---
 bitbake/lib/bb/fetch2/__init__.py |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 6211cd7..62f3b95 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -333,11 +333,18 @@ def decodeurl(url):
     if not m:
         raise MalformedUrl(url)
 
+    user = m.group('user')
+    if user:
+        n = re.compile('(?P<usr>[^:]+)(:?(?P<pswd>.*))').match(user)
+        usr = n.group('usr')
+        if usr.find('/') != -1:
+            m = re.compile('(?P<type>[^:]*)://?(?P<location>[^;]+)(;(?P<parm>.*))?').match(url)
+            user = ''
+
     type = m.group('type')
     location = m.group('location')
     if not location:
         raise MalformedUrl(url)
-    user = m.group('user')
     parm = m.group('parm')
 
     locidx = location.find('/')
-- 
1.7.9.5




More information about the bitbake-devel mailing list