[bitbake-devel] [PATCH] bb/fetch2/ssh.py: Fix urldata.localpath use os.path.normpath
Aníbal Limón
anibal.limon at linux.intel.com
Tue Jan 13 00:36:13 UTC 2015
When urls ends with trailing slash os.path.basename return "" [1]
and built urldata.localpath only with DL_DIR, it causes that
donestamp is built as DL_DIR + '.done' and seems that ssh resource
was already download.
[YOCTO #6448]
[1] https://docs.python.org/2/library/os.path.html#os.path.basename
Signed-off-by: Aníbal Limón <anibal.limon at linux.intel.com>
---
lib/bb/fetch2/ssh.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/bb/fetch2/ssh.py b/lib/bb/fetch2/ssh.py
index 4ae9794..635578a 100644
--- a/lib/bb/fetch2/ssh.py
+++ b/lib/bb/fetch2/ssh.py
@@ -87,7 +87,8 @@ class SSH(FetchMethod):
m = __pattern__.match(urldata.url)
path = m.group('path')
host = m.group('host')
- urldata.localpath = os.path.join(d.getVar('DL_DIR', True), os.path.basename(path))
+ urldata.localpath = os.path.join(d.getVar('DL_DIR', True),
+ os.path.basename(os.path.normpath(path)))
def download(self, urldata, d):
dldir = d.getVar('DL_DIR', True)
--
1.9.1
More information about the bitbake-devel
mailing list