diff options
| author | Richard Purdie <rpurdie@linux.intel.com> | 2010-08-23 13:01:05 +0100 |
|---|---|---|
| committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-08-23 13:01:05 +0100 |
| commit | 71a46a44a2f278db1ac1b309ff52b7836f3286b4 (patch) | |
| tree | 8aa510d5f43c9af7bfb9a90c06823749e46ad50e | |
| parent | 86c2b5670553322e83015df18d53bebbf51e1af5 (diff) | |
| download | poky-71a46a44a2f278db1ac1b309ff52b7836f3286b4.tar.gz | |
utils.py: Fix bb.copyfile to change the permissions of the file back correctly
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
| -rw-r--r-- | bitbake/lib/bb/utils.py | 6 |
1 files 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): | |||
| 703 | os.rename(dest + "#new", dest) | 703 | os.rename(dest + "#new", dest) |
| 704 | except Exception as e: | 704 | except Exception as e: |
| 705 | print('copyfile: copy', src, '->', dest, 'failed.', e) | 705 | print('copyfile: copy', src, '->', dest, 'failed.', e) |
| 706 | os.chmod(src, stat.S_IMODE(sstat[stat.ST_MODE])) | ||
| 707 | os.utime(src, (sstat[stat.ST_ATIME], sstat[stat.ST_MTIME])) | ||
| 708 | return False | 706 | return False |
| 707 | finally: | ||
| 708 | os.chmod(src, sstat[stat.ST_MODE]) | ||
| 709 | os.utime(src, (sstat[stat.ST_ATIME], sstat[stat.ST_MTIME])) | ||
| 710 | |||
| 709 | else: | 711 | else: |
| 710 | #we don't yet handle special, so we need to fall back to /bin/mv | 712 | #we don't yet handle special, so we need to fall back to /bin/mv |
| 711 | a = getstatusoutput("/bin/cp -f " + "'" + src + "' '" + dest + "'") | 713 | a = getstatusoutput("/bin/cp -f " + "'" + src + "' '" + dest + "'") |
