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-04 14:33:40 +0100 |
commit | 90f91f7402ff69f3fe9fba5f94a53d371303ce34 (patch) | |
tree | 9d4c9ef0c28f4af7816731645cfadde8e1a91a54 /lib/bb/utils.py | |
parent | 78efda1224a99ed3d2ca6befb9fd719d82f6b0ae (diff) | |
download | bitbake-90f91f7402ff69f3fe9fba5f94a53d371303ce34.tar.gz |
utils: use logger.warn instead of print in copyfile
print disappears into the ether, so use logger.warn and clean up the messages.
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/utils.py')
-rw-r--r-- | lib/bb/utils.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/bb/utils.py b/lib/bb/utils.py index ae3ef1054..f9ee4f1c1 100644 --- a/lib/bb/utils.py +++ b/lib/bb/utils.py @@ -724,7 +724,7 @@ def copyfile(src, dest, newmtime = None, sstat = None): if not sstat: sstat = os.lstat(src) except Exception as e: - print("copyfile: Stating source file failed...", e) + logger.warn("copyfile: stat of %s failed (%s)" % (src, e)) return False destexists = 1 @@ -751,7 +751,7 @@ def copyfile(src, dest, newmtime = None, sstat = None): #os.lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID]) return os.lstat(dest) except Exception as e: - print("copyfile: failed to properly create symlink:", dest, "->", target, e) + logger.warn("copyfile: failed to create symlink %s to %s (%s)" % (dest, target, e)) return False if stat.S_ISREG(sstat[stat.ST_MODE]): @@ -766,7 +766,7 @@ def copyfile(src, dest, newmtime = None, sstat = None): shutil.copyfile(src, dest + "#new") os.rename(dest + "#new", dest) except Exception as e: - print('copyfile: copy', src, '->', dest, 'failed.', e) + logger.warn("copyfile: copy %s to %s failed (%s)" % (src, dest, e)) return False finally: if srcchown: @@ -777,13 +777,13 @@ def copyfile(src, dest, newmtime = None, sstat = None): #we don't yet handle special, so we need to fall back to /bin/mv a = getstatusoutput("/bin/cp -f " + "'" + src + "' '" + dest + "'") if a[0] != 0: - print("copyfile: Failed to copy special file:" + src + "' to '" + dest + "'", a) + logger.warn("copyfile: failed to copy special file %s to %s (%s)" % (src, dest, a)) return False # failure try: os.lchown(dest, sstat[stat.ST_UID], sstat[stat.ST_GID]) os.chmod(dest, stat.S_IMODE(sstat[stat.ST_MODE])) # Sticky is reset on chown except Exception as e: - print("copyfile: Failed to chown/chmod/unlink", dest, e) + logger.warn("copyfile: failed to chown/chmod %s (%s)" % (dest, e)) return False if newmtime: |