mirror of
https://git.yoctoproject.org/poky
synced 2026-09-19 18:49:32 +02:00
utils.py: Fix bb.copyfile to change the permissions of the file back correctly
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
@@ -703,9 +703,11 @@ def copyfile(src, dest, newmtime = None, sstat = None):
|
|||||||
os.rename(dest + "#new", dest)
|
os.rename(dest + "#new", dest)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print('copyfile: copy', src, '->', dest, 'failed.', 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
|
return False
|
||||||
|
finally:
|
||||||
|
os.chmod(src, sstat[stat.ST_MODE])
|
||||||
|
os.utime(src, (sstat[stat.ST_ATIME], sstat[stat.ST_MTIME]))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
#we don't yet handle special, so we need to fall back to /bin/mv
|
#we don't yet handle special, so we need to fall back to /bin/mv
|
||||||
a = getstatusoutput("/bin/cp -f " + "'" + src + "' '" + dest + "'")
|
a = getstatusoutput("/bin/cp -f " + "'" + src + "' '" + dest + "'")
|
||||||
|
|||||||
Reference in New Issue
Block a user