From 71a46a44a2f278db1ac1b309ff52b7836f3286b4 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 23 Aug 2010 13:01:05 +0100 Subject: utils.py: Fix bb.copyfile to change the permissions of the file back correctly Signed-off-by: Richard Purdie --- bitbake/lib/bb/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index c8f139b192..9fc56eaa0f 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py @@ -703,9 +703,11 @@ def copyfile(src, dest, newmtime = None, sstat = None): os.rename(dest + "#new", dest) except Exception as e: print('copyfile: copy', src, '->', dest, 'failed.', e) - os.chmod(src, stat.S_IMODE(sstat[stat.ST_MODE])) - os.utime(src, (sstat[stat.ST_ATIME], sstat[stat.ST_MTIME])) return False + finally: + os.chmod(src, sstat[stat.ST_MODE]) + os.utime(src, (sstat[stat.ST_ATIME], sstat[stat.ST_MTIME])) + else: #we don't yet handle special, so we need to fall back to /bin/mv a = getstatusoutput("/bin/cp -f " + "'" + src + "' '" + dest + "'") -- cgit v1.2.3-54-g00ecf