File: 0002-Limit-search-depth-in-usr-share.patch

package info (click to toggle)
ros-catkin-pkg 1.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 708 kB
  • sloc: python: 4,704; xml: 183; makefile: 36
file content (23 lines) | stat: -rw-r--r-- 888 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org>
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