diff options
| author | Jose Quaresma <quaresma.jose@gmail.com> | 2022-09-13 04:26:43 -1000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-09-16 17:53:22 +0100 |
| commit | 625395099822137c2e008adde7f4c5de1632a834 (patch) | |
| tree | 211969c0c749d1c5c8129318fdabb69322923ea8 /bitbake/lib | |
| parent | fe2c27108af37d653d1a06367d94084081ff9898 (diff) | |
| download | poky-625395099822137c2e008adde7f4c5de1632a834.tar.gz | |
bitbake: bb/utils: movefile: use the logger for printing
(Bitbake rev: a5fff68c8c83fed52dae0bdcf2c1713566a5a53e)
Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 274b2d7a2fa0b43b0b542cb5471ff832e692ea93)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
| -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 e92d5feb2e..95b3c89805 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
| @@ -753,7 +753,7 @@ def movefile(src, dest, newmtime = None, sstat = None): | |||
| 753 | if not sstat: | 753 | if not sstat: |
| 754 | sstat = os.lstat(src) | 754 | sstat = os.lstat(src) |
| 755 | except Exception as e: | 755 | except Exception as e: |
| 756 | print("movefile: Stating source file failed...", e) | 756 | logger.warning("movefile: Stating source file failed...", e) |
| 757 | return None | 757 | return None |
| 758 | 758 | ||
| 759 | destexists = 1 | 759 | destexists = 1 |
| @@ -781,7 +781,7 @@ def movefile(src, dest, newmtime = None, sstat = None): | |||
| 781 | os.unlink(src) | 781 | os.unlink(src) |
| 782 | return os.lstat(dest) | 782 | return os.lstat(dest) |
| 783 | except Exception as e: | 783 | except Exception as e: |
| 784 | print("movefile: failed to properly create symlink:", dest, "->", target, e) | 784 | logger.warning("movefile: failed to properly create symlink:", dest, "->", target, e) |
| 785 | return None | 785 | return None |
| 786 | 786 | ||
| 787 | renamefailed = 1 | 787 | renamefailed = 1 |
| @@ -798,7 +798,7 @@ def movefile(src, dest, newmtime = None, sstat = None): | |||
| 798 | except Exception as e: | 798 | except Exception as e: |
| 799 | if e.errno != errno.EXDEV: | 799 | if e.errno != errno.EXDEV: |
| 800 | # Some random error. | 800 | # Some random error. |
| 801 | print("movefile: Failed to move", src, "to", dest, e) | 801 | logger.warning("movefile: Failed to move", src, "to", dest, e) |
| 802 | return None | 802 | return None |
| 803 | # Invalid cross-device-link 'bind' mounted or actually Cross-Device | 803 | # Invalid cross-device-link 'bind' mounted or actually Cross-Device |
| 804 | 804 | ||
| @@ -810,13 +810,13 @@ def movefile(src, dest, newmtime = None, sstat = None): | |||
| 810 | bb.utils.rename(destpath + "#new", destpath) | 810 | bb.utils.rename(destpath + "#new", destpath) |
| 811 | didcopy = 1 | 811 | didcopy = 1 |
| 812 | except Exception as e: | 812 | except Exception as e: |
| 813 | print('movefile: copy', src, '->', dest, 'failed.', e) | 813 | logger.warning('movefile: copy', src, '->', dest, 'failed.', e) |
| 814 | return None | 814 | return None |
| 815 | else: | 815 | else: |
| 816 | #we don't yet handle special, so we need to fall back to /bin/mv | 816 | #we don't yet handle special, so we need to fall back to /bin/mv |
| 817 | a = getstatusoutput("/bin/mv -f " + "'" + src + "' '" + dest + "'") | 817 | a = getstatusoutput("/bin/mv -f " + "'" + src + "' '" + dest + "'") |
| 818 | if a[0] != 0: | 818 | if a[0] != 0: |
| 819 | print("movefile: Failed to move special file:" + src + "' to '" + dest + "'", a) | 819 | logger.warning("movefile: Failed to move special file:" + src + "' to '" + dest + "'", a) |
| 820 | return None # failure | 820 | return None # failure |
| 821 | try: | 821 | try: |
| 822 | if didcopy: | 822 | if didcopy: |
| @@ -824,7 +824,7 @@ def movefile(src, dest, newmtime = None, sstat = None): | |||
| 824 | os.chmod(destpath, stat.S_IMODE(sstat[stat.ST_MODE])) # Sticky is reset on chown | 824 | os.chmod(destpath, stat.S_IMODE(sstat[stat.ST_MODE])) # Sticky is reset on chown |
| 825 | os.unlink(src) | 825 | os.unlink(src) |
| 826 | except Exception as e: | 826 | except Exception as e: |
| 827 | print("movefile: Failed to chown/chmod/unlink", dest, e) | 827 | logger.warning("movefile: Failed to chown/chmod/unlink", dest, e) |
| 828 | return None | 828 | return None |
| 829 | 829 | ||
| 830 | if newmtime: | 830 | if newmtime: |
