diff options
author | Ross Burton <ross.burton@intel.com> | 2013-10-02 17:47:28 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-10-07 09:37:33 +0100 |
commit | 95915910dfaa71d6d5b77b8b53468f77207ddc76 (patch) | |
tree | 3d522e42ddd6bab9ec55e4d775997b6c89070f8e /bitbake/lib/bb | |
parent | 0b9c3393c10030e14ca9716d7c51940e95c0c173 (diff) | |
download | poky-95915910dfaa71d6d5b77b8b53468f77207ddc76.tar.gz |
bitbake: utils: use logger.warn instead of print in copyfile
print disappears into the ether, so use logger.warn and clean up the messages.
(Bitbake rev: 90f91f7402ff69f3fe9fba5f94a53d371303ce34)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r-- | bitbake/lib/bb/utils.py | 10 |
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: |