commit:     125142667c338eddb3777433e513fbe58e7bfd45
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul  9 22:35:33 2022 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Jul  9 22:42:48 2022 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=12514266

eclean: add early return for empty DISTDIR

Gentoo-bug-url: https://bugs.gentoo.org/703282

Signed-off-by: Brian Dolbec <dolsen <AT> gentoo.org>

 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:

Reply via email to