Skip to contentSkip to conversation

bb/fetch2/ssh.py: Fix urldata.localpath use os.path.normpath

PATCH New Aníbal Limón 1 participant 1 message Jan 13, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bb/fetch2/ssh.py: Fix urldata.localpath use os.path.normpath

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

---
 lib/bb/fetch2/ssh.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lib/bb/fetch2/ssh.py +2 -1
index 4ae9794..635578a 100644
@@ -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)
Signature · 1 line
1.9.1