Skip to contentSkip to conversation

devtool: upgrade: use shutil.move instead of os.rename

PATCH In review Markus Lehtonen 2 participants 2 messages Sep 22, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 devtool: upgrade: use shutil.move instead of os.rename

Rename fails over filesystem boundaries.

---
 scripts/lib/devtool/upgrade.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/lib/devtool/upgrade.py +1 -1
index e74e795..18e010c 100644
@@ -53,7 +53,7 @@ def _copy_source_code(orig, dest):
         dest_dir = os.path.join(dest, os.path.dirname(path))
         bb.utils.mkdirhier(dest_dir)
         dest_path = os.path.join(dest, path)
-        os.rename(os.path.join(orig, path), dest_path)
+        shutil.move(os.path.join(orig, path), dest_path)
 
 def _get_checksums(rf):
     import re
Signature · 1 line
2.1.4
Acked-by on v1 1/1
#1 lore raw
Quoted 12 lines · On Tuesday 22 September 2015 14:24:04 Markus Lehtonen wrote:

Rename fails over filesystem boundaries.

---
 scripts/lib/devtool/upgrade.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/lib/devtool/upgrade.py +0 -0
index e74e795..18e010c 100644

scripts/lib/devtool/upgrade.py def _copy_source_code(orig, dest): · line 59

Quoted 8 lines
scripts/lib/devtool/upgrade.py +1 -1
@@ -53,7 +53,7 @@ def _copy_source_code(orig, dest):
         dest_dir = os.path.join(dest, os.path.dirname(path))
         bb.utils.mkdirhier(dest_dir)
         dest_path = os.path.join(dest, path)
-        os.rename(os.path.join(orig, path), dest_path)
+        shutil.move(os.path.join(orig, path), dest_path)
 
 def _get_checksums(rf):
     import re

Ah yes, good catch.

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre