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>
This commit is contained in:
Nitin A Kamble
2010-06-03 21:50:02 -07:00
committed by Richard Purdie
parent 807e983632
commit c3682bf89b

View File

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