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 v2] fetch: Make FlatLayout.get_filenames() not return directories
Date: Sun, 13 Oct 2019 19:48:42
Message-Id: e0e5d1c7-fb59-2e93-8460-7fe9a4711c2e@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH v2] fetch: Make FlatLayout.get_filenames() not return directories by "Michał Górny"
1 On 10/13/19 12:46 PM, Michał Górny wrote:
2 > Stop returning directories from FlatLayout.get_filenames(). This causes
3 > emirrordist to wrongly presume directories created by new layout
4 > to be distfiles, and causes some noisy errors.
5 >
6 > Signed-off-by: Michał Górny <mgorny@g.o>
7 > ---
8 > lib/portage/package/ebuild/fetch.py | 5 ++++-
9 > 1 file changed, 4 insertions(+), 1 deletion(-)
10 >
11 > diff --git a/lib/portage/package/ebuild/fetch.py b/lib/portage/package/ebuild/fetch.py
12 > index 5d0bc7355..cd204b755 100644
13 > --- a/lib/portage/package/ebuild/fetch.py
14 > +++ b/lib/portage/package/ebuild/fetch.py
15 > @@ -35,6 +35,7 @@ portage.proxy.lazyimport.lazyimport(globals(),
16 > 'portage.util:atomic_ofstream',
17 > 'portage.util.configparser:SafeConfigParser,read_configs,' +
18 > 'ConfigParserError',
19 > + 'portage.util.install_mask:_raise_exc',
20 > 'portage.util._urlopen:urlopen',
21 > )
22 >
23 > @@ -269,7 +270,9 @@ class FlatLayout(object):
24 > return filename
25 >
26 > def get_filenames(self, distdir):
27 > - return iter(os.listdir(distdir))
28 > + for dirpath, dirnames, filenames in os.walk(distdir,
29 > + onerror=_raise_exc):
30 > + return iter(filenames)
31 >
32 > @staticmethod
33 > def verify_args(args):
34 >
35
36 Looks good. Please merge.
37 --
38 Thanks,
39 Zac

Attachments

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