diff options
author | 2021-04-19 11:23:58 -0300 | |
---|---|---|
committer | 2021-05-06 11:14:06 +0100 | |
commit | 656a65b2b84e7d529b89cf5de7eb838f902d84a2 (patch) | |
tree | 273aa600fe078b7c7b1f66859606010f1c016a82 /meta/lib/oe/package_manager | |
parent | ed2b18ed6e76a3bc050a1c48526c114de5cb1a93 (diff) | |
download | openembedded-core-contrib-656a65b2b84e7d529b89cf5de7eb838f902d84a2.tar.gz |
classes/lib/scripts: Use bb.utils.rename() instead of os.rename()
Incremental build in Docker fails with:
OSError: [Errno 18] Invalid cross-device link
when source and destination are on different overlay filesystems.
Rather than adding fallback code to every call site, use a new wrapper
in bitbake which detects this case and falls back to shutil.move
which is slower but will handtle the overlay docker filesystems correctly.
[YOCTO #14301]
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/package_manager')
-rw-r--r-- | meta/lib/oe/package_manager/deb/__init__.py | 6 | ||||
-rw-r--r-- | meta/lib/oe/package_manager/ipk/__init__.py | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/meta/lib/oe/package_manager/deb/__init__.py b/meta/lib/oe/package_manager/deb/__init__.py index 2ee68fefb1..a4b6b6f647 100644 --- a/meta/lib/oe/package_manager/deb/__init__.py +++ b/meta/lib/oe/package_manager/deb/__init__.py @@ -214,7 +214,7 @@ class DpkgPM(OpkgDpkgPM): tmp_sf.write(status) - os.rename(status_file + ".tmp", status_file) + bb.utils.rename(status_file + ".tmp", status_file) def run_pre_post_installs(self, package_name=None): """ @@ -299,13 +299,13 @@ class DpkgPM(OpkgDpkgPM): for dir in dirs: new_dir = re.sub(r"\.dpkg-new", "", dir) if dir != new_dir: - os.rename(os.path.join(root, dir), + bb.utils.rename(os.path.join(root, dir), os.path.join(root, new_dir)) for file in files: new_file = re.sub(r"\.dpkg-new", "", file) if file != new_file: - os.rename(os.path.join(root, file), + bb.utils.rename(os.path.join(root, file), os.path.join(root, new_file)) diff --git a/meta/lib/oe/package_manager/ipk/__init__.py b/meta/lib/oe/package_manager/ipk/__init__.py index da488c1c7f..4cd3963111 100644 --- a/meta/lib/oe/package_manager/ipk/__init__.py +++ b/meta/lib/oe/package_manager/ipk/__init__.py @@ -213,7 +213,7 @@ class OpkgPM(OpkgDpkgPM): tmp_sf.write(status) - os.rename(status_file + ".tmp", status_file) + bb.utils.rename(status_file + ".tmp", status_file) def _create_custom_config(self): bb.note("Building from feeds activated!") |