]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
yocto-bsp: have replace_file() close file before copying
authorTom Zanussi <tom.zanussi@linux.intel.com>
Fri, 29 Mar 2013 21:48:50 +0000 (16:48 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 5 Apr 2013 21:54:24 +0000 (22:54 +0100)
replace_file needs to make sure the file it's replacing is closed
before replacing it, otherwise unexpected results may ensue.

Fixes [YOCTO #4145].

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
scripts/lib/bsp/engine.py

index 86cb51c5f43b4a0d5c09d778aca6e042326dacd8..36bd446e2b2536717fd582ea28992705bfd658c1 100644 (file)
@@ -571,7 +571,8 @@ def replace_file(replace_this, with_this):
     the original filename.
     """
     try:
-        shutil.copy(with_this, replace_this)
+        replace_this.close()
+        shutil.copy(with_this, replace_this.name)
     except IOError:
         pass