[bitbake-devel] [Fwd: [PATCH] utils.movefile: specify dest file name]
Esquivel, Benjamin
benjamin.esquivel at intel.com
Tue Sep 1 17:25:15 UTC 2015
Sending this to the right list.
Benjamin
-------- Forwarded Message --------
From: Benjamin Esquivel <benjamin.esquivel at linux.intel.com>
To: openembedded-core at lists.openembedded.org
Cc: paul.eggleton at linux.intel.com, Benjamin Esquivel <
benjamin.esquivel at linux.intel.com>
Subject: [PATCH] utils.movefile: specify dest file name
Date: Thu, 20 Aug 2015 13:59:58 +0000
> When moving a file via the os.rename function, it was missing the
> destination file name which caused an OSError
>
> [YOCTO#8180]
>
> Signed-off-by: Benjamin Esquivel <benjamin.esquivel at linux.intel.com>
> ---
> bitbake/lib/bb/utils.py | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
> index 5b94432..5eec787 100644
> --- a/bitbake/lib/bb/utils.py
> +++ b/bitbake/lib/bb/utils.py
> @@ -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:
> --
> 2.3.0
>
More information about the bitbake-devel
mailing list