commit: 0e8d17b56f5b86bd4b66d4720808e8b30c90a0ed Author: Michał Górny <mgorny <AT> gentoo <DOT> org> AuthorDate: Sun Oct 13 11:55:29 2019 +0000 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> CommitDate: Sun Oct 13 19:49:49 2019 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=0e8d17b5
fetch: Make FlatLayout.get_filenames() not return directories Stop returning directories from FlatLayout.get_filenames(). This causes emirrordist to wrongly presume directories created by new layout to be distfiles, and causes some noisy errors. Reviewed-by: Zac Medico <zmedico <AT> gentoo.org> Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> lib/portage/package/ebuild/fetch.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/portage/package/ebuild/fetch.py b/lib/portage/package/ebuild/fetch.py index 5d0bc7355..cd204b755 100644 --- a/lib/portage/package/ebuild/fetch.py +++ b/lib/portage/package/ebuild/fetch.py @@ -35,6 +35,7 @@ portage.proxy.lazyimport.lazyimport(globals(), 'portage.util:atomic_ofstream', 'portage.util.configparser:SafeConfigParser,read_configs,' + 'ConfigParserError', + 'portage.util.install_mask:_raise_exc', 'portage.util._urlopen:urlopen', ) @@ -269,7 +270,9 @@ class FlatLayout(object): return filename def get_filenames(self, distdir): - return iter(os.listdir(distdir)) + for dirpath, dirnames, filenames in os.walk(distdir, + onerror=_raise_exc): + return iter(filenames) @staticmethod def verify_args(args):