From 125142667c338eddb3777433e513fbe58e7bfd45 Mon Sep 17 00:00:00 2001 From: Brian Dolbec Date: Sat, 9 Jul 2022 15:35:33 -0700 Subject: eclean: add early return for empty DISTDIR Gentoo-bug-url: https://bugs.gentoo.org/703282 Signed-off-by: Brian Dolbec --- pym/gentoolkit/eclean/search.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pym/gentoolkit/eclean/search.py b/pym/gentoolkit/eclean/search.py index 365970c..60ced02 100644 --- a/pym/gentoolkit/eclean/search.py +++ b/pym/gentoolkit/eclean/search.py @@ -111,6 +111,10 @@ class DistfilesSearch: saved = {} deprecated = {} installed_included = False + # Check if DISTDIR is empty, return early + if not os.listdir(_distdir): + return clean_me, saved, deprecated + # create a big CPV->SRC_URI dict of packages # whose distfiles should be kept if (not destructive) or fetch_restricted: -- cgit v1.2.3