Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o, "Michał Górny" <mgorny@g.o>
Subject: Re: [gentoo-portage-dev] [PATCH] emirrordist: Delete potential symlinks for all layouts
Date: Thu, 17 Oct 2019 18:02:10
Message-Id: 513b1a39-ca5d-ceeb-a403-701704cd55bb@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH] emirrordist: Delete potential symlinks for all layouts by "Michał Górny"
1 On 10/17/19 5:09 AM, Michał Górny wrote:
2 > Unlink for all distfile layouts rather than for all but primary. This
3 > wrongly assumed that the primary layout will always be removed
4 > as a result of earlier code. However, the rename() call correctly
5 > assumes that the primary layout may be an old symlink, and operates
6 > on realpath(). Therefore, the real file from a secondary layout may
7 > be renamed, leaving dangling symlink.
8 >
9 > Bug: https://bugs.gentoo.org/697906
10 > Signed-off-by: Michał Górny <mgorny@g.o>
11 > ---
12 > lib/portage/_emirrordist/DeletionTask.py | 2 +-
13 > 1 file changed, 1 insertion(+), 1 deletion(-)
14 >
15 > diff --git a/lib/portage/_emirrordist/DeletionTask.py b/lib/portage/_emirrordist/DeletionTask.py
16 > index db5ac5ffb..a4bb29419 100644
17 > --- a/lib/portage/_emirrordist/DeletionTask.py
18 > +++ b/lib/portage/_emirrordist/DeletionTask.py
19 > @@ -102,7 +102,7 @@ class DeletionTask(CompositeTask):
20 >
21 > def _delete_links(self):
22 > success = True
23 > - for layout in self.config.layouts[1:]:
24 > + for layout in self.config.layouts:
25 > distfile_path = os.path.join(
26 > self.config.options.distfiles,
27 > layout.get_path(self.distfile))
28 >
29
30 Looks good. Please merge.
31 --
32 Thanks,
33 Zac

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies