summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/utils.py')
-rw-r--r--bitbake/lib/bb/utils.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index ae3ef1054b..f9ee4f1c1d 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -724,7 +724,7 @@ def copyfile(src, dest, newmtime = None, sstat = None):
724 if not sstat: 724 if not sstat:
725 sstat = os.lstat(src) 725 sstat = os.lstat(src)
726 except Exception as e: 726 except Exception as e:
727 print("copyfile: Stating source file failed...", e) 727 logger.warn("copyfile: stat of %s failed (%s)" % (src, e))
728 return False 728 return False
729 729
730 destexists = 1 730 destexists = 1
@@ -751,7 +751,7 @@ def copyfile(src, dest, newmtime = None, sstat = None):
751 #os.lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID]) 751 #os.lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID])
752 return os.lstat(dest) 752 return os.lstat(dest)
753 except Exception as e: 753 except Exception as e:
754 print("copyfile: failed to properly create symlink:", dest, "->", target, e) 754 logger.warn("copyfile: failed to create symlink %s to %s (%s)" % (dest, target, e))
755 return False 755 return False
756 756
757 if stat.S_ISREG(sstat[stat.ST_MODE]): 757 if stat.S_ISREG(sstat[stat.ST_MODE]):
@@ -766,7 +766,7 @@ def copyfile(src, dest, newmtime = None, sstat = None):
766 shutil.copyfile(src, dest + "#new") 766 shutil.copyfile(src, dest + "#new")
767 os.rename(dest + "#new", dest) 767 os.rename(dest + "#new", dest)
768 except Exception as e: 768 except Exception as e:
769 print('copyfile: copy', src, '->', dest, 'failed.', e) 769 logger.warn("copyfile: copy %s to %s failed (%s)" % (src, dest, e))
770 return False 770 return False
771 finally: 771 finally:
772 if srcchown: 772 if srcchown:
@@ -777,13 +777,13 @@ def copyfile(src, dest, newmtime = None, sstat = None):
777 #we don't yet handle special, so we need to fall back to /bin/mv 777 #we don't yet handle special, so we need to fall back to /bin/mv
778 a = getstatusoutput("/bin/cp -f " + "'" + src + "' '" + dest + "'") 778 a = getstatusoutput("/bin/cp -f " + "'" + src + "' '" + dest + "'")
779 if a[0] != 0: 779 if a[0] != 0:
780 print("copyfile: Failed to copy special file:" + src + "' to '" + dest + "'", a) 780 logger.warn("copyfile: failed to copy special file %s to %s (%s)" % (src, dest, a))
781 return False # failure 781 return False # failure
782 try: 782 try:
783 os.lchown(dest, sstat[stat.ST_UID], sstat[stat.ST_GID]) 783 os.lchown(dest, sstat[stat.ST_UID], sstat[stat.ST_GID])
784 os.chmod(dest, stat.S_IMODE(sstat[stat.ST_MODE])) # Sticky is reset on chown 784 os.chmod(dest, stat.S_IMODE(sstat[stat.ST_MODE])) # Sticky is reset on chown
785 except Exception as e: 785 except Exception as e:
786 print("copyfile: Failed to chown/chmod/unlink", dest, e) 786 logger.warn("copyfile: failed to chown/chmod %s (%s)" % (dest, e))
787 return False 787 return False
788 788
789 if newmtime: 789 if newmtime: