diff options
| author | Jose Quaresma <quaresma.jose@gmail.com> | 2022-07-19 10:40:11 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-07-28 11:55:06 +0100 |
| commit | ace415e6221cd9b60da6f476d9619214ec3c5c23 (patch) | |
| tree | ff8c76b938a7167fefffe9852e937c5afc3dd68b /bitbake/lib/bb/utils.py | |
| parent | 895779fd7e7c1841603046f838b8b89d85c6f4f8 (diff) | |
| download | poky-ace415e6221cd9b60da6f476d9619214ec3c5c23.tar.gz | |
bitbake: bb/utils: movefile: use the logger for printing
(Bitbake rev: 274b2d7a2fa0b43b0b542cb5471ff832e692ea93)
Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/utils.py')
| -rw-r--r-- | bitbake/lib/bb/utils.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 512cc4eb76..19ed68ea62 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
| @@ -751,7 +751,7 @@ def movefile(src, dest, newmtime = None, sstat = None): | |||
| 751 | if not sstat: | 751 | if not sstat: |
| 752 | sstat = os.lstat(src) | 752 | sstat = os.lstat(src) |
| 753 | except Exception as e: | 753 | except Exception as e: |
| 754 | print("movefile: Stating source file failed...", e) | 754 | logger.warning("movefile: Stating source file failed...", e) |
| 755 | return None | 755 | return None |
| 756 | 756 | ||
| 757 | destexists = 1 | 757 | destexists = 1 |
| @@ -779,7 +779,7 @@ def movefile(src, dest, newmtime = None, sstat = None): | |||
| 779 | os.unlink(src) | 779 | os.unlink(src) |
| 780 | return os.lstat(dest) | 780 | return os.lstat(dest) |
| 781 | except Exception as e: | 781 | except Exception as e: |
| 782 | print("movefile: failed to properly create symlink:", dest, "->", target, e) | 782 | logger.warning("movefile: failed to properly create symlink:", dest, "->", target, e) |
| 783 | return None | 783 | return None |
| 784 | 784 | ||
| 785 | renamefailed = 1 | 785 | renamefailed = 1 |
| @@ -796,7 +796,7 @@ def movefile(src, dest, newmtime = None, sstat = None): | |||
| 796 | except Exception as e: | 796 | except Exception as e: |
| 797 | if e.errno != errno.EXDEV: | 797 | if e.errno != errno.EXDEV: |
| 798 | # Some random error. | 798 | # Some random error. |
| 799 | print("movefile: Failed to move", src, "to", dest, e) | 799 | logger.warning("movefile: Failed to move", src, "to", dest, e) |
| 800 | return None | 800 | return None |
| 801 | # Invalid cross-device-link 'bind' mounted or actually Cross-Device | 801 | # Invalid cross-device-link 'bind' mounted or actually Cross-Device |
| 802 | 802 | ||
| @@ -808,13 +808,13 @@ def movefile(src, dest, newmtime = None, sstat = None): | |||
| 808 | bb.utils.rename(destpath + "#new", destpath) | 808 | bb.utils.rename(destpath + "#new", destpath) |
| 809 | didcopy = 1 | 809 | didcopy = 1 |
| 810 | except Exception as e: | 810 | except Exception as e: |
| 811 | print('movefile: copy', src, '->', dest, 'failed.', e) | 811 | logger.warning('movefile: copy', src, '->', dest, 'failed.', e) |
| 812 | return None | 812 | return None |
| 813 | else: | 813 | else: |
| 814 | #we don't yet handle special, so we need to fall back to /bin/mv | 814 | #we don't yet handle special, so we need to fall back to /bin/mv |
| 815 | a = getstatusoutput("/bin/mv -f " + "'" + src + "' '" + dest + "'") | 815 | a = getstatusoutput("/bin/mv -f " + "'" + src + "' '" + dest + "'") |
| 816 | if a[0] != 0: | 816 | if a[0] != 0: |
| 817 | print("movefile: Failed to move special file:" + src + "' to '" + dest + "'", a) | 817 | logger.warning("movefile: Failed to move special file:" + src + "' to '" + dest + "'", a) |
| 818 | return None # failure | 818 | return None # failure |
| 819 | try: | 819 | try: |
| 820 | if didcopy: | 820 | if didcopy: |
| @@ -822,7 +822,7 @@ def movefile(src, dest, newmtime = None, sstat = None): | |||
| 822 | os.chmod(destpath, stat.S_IMODE(sstat[stat.ST_MODE])) # Sticky is reset on chown | 822 | os.chmod(destpath, stat.S_IMODE(sstat[stat.ST_MODE])) # Sticky is reset on chown |
| 823 | os.unlink(src) | 823 | os.unlink(src) |
| 824 | except Exception as e: | 824 | except Exception as e: |
| 825 | print("movefile: Failed to chown/chmod/unlink", dest, e) | 825 | logger.warning("movefile: Failed to chown/chmod/unlink", dest, e) |
| 826 | return None | 826 | return None |
| 827 | 827 | ||
| 828 | if newmtime: | 828 | if newmtime: |
