[bitbake-devel] [PATCH] utils.py: Support cross device move into existing directory

Tobias Hagelborn tobias.hagelborn at axis.com
Mon Jan 29 14:59:52 UTC 2018


movefile fails copying files cross-device into existing target
directory.

Using copy instead of copyfile in this case.

Signed-off-by: Tobias Hagelborn <tobiasha at axis.com>
---
 bitbake/lib/bb/utils.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index c540b49..6769ed6 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -791,9 +791,8 @@ def movefile(src, dest, newmtime = None, sstat = None):
     if renamefailed:
         didcopy = 0
         if stat.S_ISREG(sstat[stat.ST_MODE]):
-            try: # For safety copy then move it over.
-                shutil.copyfile(src, destpath + "#new")
-                os.rename(destpath + "#new", destpath)
+            try:
+                shutil.copy(src, dest)
                 didcopy = 1
             except Exception as e:
                 print('movefile: copy', src, '->', dest, 'failed.', e)
-- 
2.1.4




More information about the bitbake-devel mailing list