1 |
After rename of a nonexistent symlink target fails, detect a |
2 |
broken symlink and simply delete it. |
3 |
|
4 |
Fixes: 0d34d89d5028 ("emirrordist: Implement mirror layout.conf support") |
5 |
Bug: https://bugs.gentoo.org/699400 |
6 |
Signed-off-by: Zac Medico <zmedico@g.o> |
7 |
--- |
8 |
lib/portage/_emirrordist/DeletionTask.py | 5 +++++ |
9 |
1 file changed, 5 insertions(+) |
10 |
|
11 |
diff --git a/lib/portage/_emirrordist/DeletionTask.py b/lib/portage/_emirrordist/DeletionTask.py |
12 |
index 5eb01d840..49f13ddf7 100644 |
13 |
--- a/lib/portage/_emirrordist/DeletionTask.py |
14 |
+++ b/lib/portage/_emirrordist/DeletionTask.py |
15 |
@@ -28,6 +28,11 @@ class DeletionTask(CompositeTask): |
16 |
recycle_path) |
17 |
except OSError as e: |
18 |
if e.errno != errno.EXDEV: |
19 |
+ if os.path.islink(self.distfile_path) and not os.path.exists(self.distfile_path): |
20 |
+ self._delete_links() |
21 |
+ self._async_wait() |
22 |
+ return |
23 |
+ |
24 |
logging.error(("rename %s from distfiles to " |
25 |
"recycle failed: %s") % (self.distfile, e)) |
26 |
else: |
27 |
-- |
28 |
2.21.0 |