diff options
author | Devendra Tewari <devendra.tewari@gmail.com> | 2021-04-19 11:23:58 -0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-04-23 10:12:12 +0100 |
commit | 8d48138e9b1f3577cfba64b4757b576c27c6ef04 (patch) | |
tree | 9c67de3630ffde438b70e92cf6864103233bc149 /meta/lib/oe/package_manager/ipk/__init__.py | |
parent | f2d1523b19cb066a4a06609f036822fe4a8b43f0 (diff) | |
download | openembedded-core-contrib-8d48138e9b1f3577cfba64b4757b576c27c6ef04.tar.gz |
classes/lib/scripts: Use shutil.move when os.rename fails
Incremental build in Docker fails with:
OSError: [Errno 18] Invalid cross-device link
when source and destination are on different overlay filesystems.
This change handles error with os.rename and retries with shutil.move.
The reason os.rename is still used is because shutil.move is too slow
for speed sensitive sections of code.
[YOCTO #14301]
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/package_manager/ipk/__init__.py')
-rw-r--r-- | meta/lib/oe/package_manager/ipk/__init__.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/meta/lib/oe/package_manager/ipk/__init__.py b/meta/lib/oe/package_manager/ipk/__init__.py index da488c1c7f..2aa21949f3 100644 --- a/meta/lib/oe/package_manager/ipk/__init__.py +++ b/meta/lib/oe/package_manager/ipk/__init__.py @@ -213,7 +213,10 @@ class OpkgPM(OpkgDpkgPM): tmp_sf.write(status) - os.rename(status_file + ".tmp", status_file) + try: + os.rename(status_file + ".tmp", status_file) + except OSError: + shutil.move(status_file + ".tmp", status_file) def _create_custom_config(self): bb.note("Building from feeds activated!") |