From: =?utf-8?q?Timo_R=C3=B6hling?= Date: Sun, 2 Oct 2022 18:39:38 +0200 Subject: Limit search depth in /usr/share --- src/catkin_pkg/packages.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/catkin_pkg/packages.py b/src/catkin_pkg/packages.py index 36b5144..724cc2b 100644 --- a/src/catkin_pkg/packages.py +++ b/src/catkin_pkg/packages.py @@ -71,6 +71,10 @@ def find_package_paths(basepath, exclude_paths=None, exclude_subspaces=False, ig paths.append(os.path.relpath(dirpath, basepath)) del dirnames[:] continue + if dirpath.startswith('/usr/share/'): + # Limit search depth in /usr/share to one level + del dirnames[:] + continue # filter out hidden directories in-place dirnames[:] = [d for d in dirnames if not d.startswith('.')] return paths