diff options
author | Devendra Tewari <devendra.tewari@gmail.com> | 2021-04-19 11:23:58 -0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-05-06 11:16:23 +0100 |
commit | b71375304f393db62e0894af66e9a60bb9a5c8cc (patch) | |
tree | ac14a351c1c6cd0ba2679c18a4de92c71dee0e7f /meta/classes/update-alternatives.bbclass | |
parent | 974441aeda1a2e601865743e945e0332c115ef76 (diff) | |
download | poky-b71375304f393db62e0894af66e9a60bb9a5c8cc.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]
(From OE-Core rev: 656a65b2b84e7d529b89cf5de7eb838f902d84a2)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/update-alternatives.bbclass')
-rw-r--r-- | meta/classes/update-alternatives.bbclass | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/classes/update-alternatives.bbclass b/meta/classes/update-alternatives.bbclass index 8c2b66e7f1..000e4d5664 100644 --- a/meta/classes/update-alternatives.bbclass +++ b/meta/classes/update-alternatives.bbclass | |||
@@ -184,7 +184,7 @@ python apply_update_alternative_renames () { | |||
184 | link_rename.append((alt_target, alt_target_rename)) | 184 | link_rename.append((alt_target, alt_target_rename)) |
185 | else: | 185 | else: |
186 | bb.note('%s: Rename %s -> %s' % (pn, alt_target, alt_target_rename)) | 186 | bb.note('%s: Rename %s -> %s' % (pn, alt_target, alt_target_rename)) |
187 | os.rename(src, dest) | 187 | bb.utils.rename(src, dest) |
188 | update_files(alt_target, alt_target_rename, pkg, d) | 188 | update_files(alt_target, alt_target_rename, pkg, d) |
189 | else: | 189 | else: |
190 | bb.warn("%s: alternative target (%s or %s) does not exist, skipping..." % (pn, alt_target, alt_target_rename)) | 190 | bb.warn("%s: alternative target (%s or %s) does not exist, skipping..." % (pn, alt_target, alt_target_rename)) |
@@ -201,7 +201,7 @@ python apply_update_alternative_renames () { | |||
201 | if os.path.lexists(link_target): | 201 | if os.path.lexists(link_target): |
202 | # Ok, the link_target exists, we can rename | 202 | # Ok, the link_target exists, we can rename |
203 | bb.note('%s: Rename (link) %s -> %s' % (pn, alt_target, alt_target_rename)) | 203 | bb.note('%s: Rename (link) %s -> %s' % (pn, alt_target, alt_target_rename)) |
204 | os.rename(src, dest) | 204 | bb.utils.rename(src, dest) |
205 | else: | 205 | else: |
206 | # Try to resolve the broken link to link.${BPN} | 206 | # Try to resolve the broken link to link.${BPN} |
207 | link_maybe = '%s.%s' % (os.readlink(src), pn) | 207 | link_maybe = '%s.%s' % (os.readlink(src), pn) |