summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-08-20 15:11:44 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-08-20 15:11:44 +0100
commit75b57d573c8e129d3ae8821e81e76ebf4b37fbfb (patch)
tree0e64d8031555a8622c65fa03e36b5fe6a09af108 /bitbake
parentac3452c4316dce4b8d2620214087ab110c4573f6 (diff)
downloadpoky-75b57d573c8e129d3ae8821e81e76ebf4b37fbfb.tar.gz
bitbake/utils.py: Allow copyfile to copy files which aren't readable
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/utils.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index fd7948f1de..56577dabe1 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -686,11 +686,14 @@ def copyfile(src, dest, newmtime = None, sstat = None):
686 return False 686 return False
687 687
688 if stat.S_ISREG(sstat[stat.ST_MODE]): 688 if stat.S_ISREG(sstat[stat.ST_MODE]):
689 os.chmod(src, stat.S_IRUSR) # Make sure we can read it
689 try: # For safety copy then move it over. 690 try: # For safety copy then move it over.
690 shutil.copyfile(src, dest + "#new") 691 shutil.copyfile(src, dest + "#new")
691 os.rename(dest + "#new", dest) 692 os.rename(dest + "#new", dest)
692 except Exception as e: 693 except Exception as e:
693 print('copyfile: copy', src, '->', dest, 'failed.', e) 694 print('copyfile: copy', src, '->', dest, 'failed.', e)
695 os.chmod(src, stat.S_IMODE(sstat[stat.ST_MODE]))
696 os.utime(src, (sstat[stat.ST_ATIME], sstat[stat.ST_MTIME]))
694 return False 697 return False
695 else: 698 else:
696 #we don't yet handle special, so we need to fall back to /bin/mv 699 #we don't yet handle special, so we need to fall back to /bin/mv