1 |
On 10/13/19 4:57 AM, 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 | 3 ++- |
9 |
> 1 file changed, 2 insertions(+), 1 deletion(-) |
10 |
> |
11 |
> diff --git a/lib/portage/package/ebuild/fetch.py b/lib/portage/package/ebuild/fetch.py |
12 |
> index 5d0bc7355..793402137 100644 |
13 |
> --- a/lib/portage/package/ebuild/fetch.py |
14 |
> +++ b/lib/portage/package/ebuild/fetch.py |
15 |
> @@ -269,7 +269,8 @@ class FlatLayout(object): |
16 |
> return filename |
17 |
> |
18 |
> def get_filenames(self, distdir): |
19 |
> - return iter(os.listdir(distdir)) |
20 |
> + for dirpath, dirnames, filenames in os.walk(distdir): |
21 |
> + return iter(filenames) |
22 |
|
23 |
Since os.walk will silently fail if distdir suddenly disappears somehow, |
24 |
we should use the onerror parameter to force it to raise an exception in |
25 |
this (albeit unlikely) case. The portage.util.install_mask._raise_exc |
26 |
function works perfectly well for this kind of onerror handler. |
27 |
|
28 |
Otherwise, looks good. |
29 |
-- |
30 |
Thanks, |
31 |
Zac |