From df1ad143c3addd68b111e1544ce572c044fac1ca Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Fri, 29 Mar 2013 16:48:50 -0500 Subject: yocto-bsp: have replace_file() close file before copying replace_file needs to make sure the file it's replacing is closed before replacing it, otherwise unexpected results may ensue. Fixes [YOCTO #4145]. (From meta-yocto rev: 1339dbb690d51456b4474356992e430638469e47) Signed-off-by: Tom Zanussi Signed-off-by: Richard Purdie --- scripts/lib/bsp/engine.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/lib/bsp/engine.py b/scripts/lib/bsp/engine.py index 86cb51c5f4..36bd446e2b 100644 --- a/scripts/lib/bsp/engine.py +++ b/scripts/lib/bsp/engine.py @@ -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 -- cgit v1.2.3-54-g00ecf