bitbake: utils: Specify dest file name in movefile()

When moving a file via the os.rename function, it was missing the
 destination file name which caused an OSError

 [YOCTO#8180]

(Bitbake rev: b147ba0341d87e077bd2b09ef4355976ecd2d26b)

Signed-off-by: Benjamin Esquivel <benjamin.esquivel@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Benjamin Esquivel
2015-08-20 13:59:58 +00:00
committed by Richard Purdie
parent 383450c78a
commit f321655ad8

View File

@@ -741,7 +741,9 @@ def movefile(src, dest, newmtime = None, sstat = None):
renamefailed = 1
if sstat[stat.ST_DEV] == dstat[stat.ST_DEV]:
try:
os.rename(src, dest)
# os.rename needs to know the destination path with file name
destfile = os.path.join(dest, os.path.basename(src))
os.rename(src, destfile)
renamefailed = 0
except Exception as e:
if e[0] != errno.EXDEV: