Преглед изворни кода

bitbake decodeurl: fix the file:// url handling

Without this patch decoding a url of this kind file://dir/filename gives
path=/filename host=dir.
With the patch it decodes as path=/dir/filename host=""

Probably nobody stumbled on this issue yet because nobody used
file:// urls with directory names in the path.

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Nitin A Kamble пре 15 година
родитељ
комит
c3682bf89b
1 измењених фајлова са 4 додато и 1 уклоњено
  1. 4 1
      bitbake/lib/bb/fetch/__init__.py

+ 4 - 1
bitbake/lib/bb/fetch/__init__.py

@@ -57,6 +57,9 @@ def decodeurl(url):
     >>> decodeurl("http://www.google.com/index.html")
     ('http', 'www.google.com', '/index.html', '', '', {})
 
+    >>> decodeurl("file://gas/COPYING")
+    ('file', '', 'gas/COPYING', '', '', {})
+
     CVS url with username, host and cvsroot. The cvs module to check out is in the
     parameters:
 
@@ -82,7 +85,7 @@ def decodeurl(url):
     parm = m.group('parm')
 
     locidx = location.find('/')
-    if locidx != -1:
+    if locidx != -1 and type.lower() != 'file':
         host = location[:locidx]
         path = location[locidx:]
     else: