bb/fetch2/ssh.py: Fix urldata.localpath use os.path.normpath
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
Signed-off-by Aníbal Limón <[email protected]>
--- lib/bb/fetch2/ssh.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
lib/bb/fetch2/ssh.py +2 -1
@@ -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