Files
gentoo/dev-python/catkin_pkg/files/infinite_loop5.patch
Alexis Ballier 598819d1a3 dev-python/catkin_pkg: bump to 0.5.2
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Alexis Ballier <aballier@gentoo.org>
2022-07-06 17:14:04 +02:00

28 lines
1.3 KiB
Diff

https://bugs.gentoo.org/show_bug.cgi?id=612860
By Tim Rakowski
We os.walk /usr with followlinks=True, but at least nodejs contains a "recursive" link in /usr/include/node
Index: catkin_pkg-0.5.2/src/catkin_pkg/packages.py
===================================================================
--- catkin_pkg-0.5.2.orig/src/catkin_pkg/packages.py
+++ catkin_pkg-0.5.2/src/catkin_pkg/packages.py
@@ -61,7 +61,9 @@ def find_package_paths(basepath, exclude
"""
paths = []
real_exclude_paths = [os.path.realpath(p) for p in exclude_paths] if exclude_paths is not None else []
+ visited = set()
for dirpath, dirnames, filenames in os.walk(basepath, followlinks=True):
+ visited.add(dirpath)
if set(dirnames + filenames) & ignore_markers or \
os.path.realpath(dirpath) in real_exclude_paths or \
(exclude_subspaces and '.catkin' in filenames):
@@ -72,7 +74,7 @@ def find_package_paths(basepath, exclude
del dirnames[:]
continue
# filter out hidden directories in-place
- dirnames[:] = [d for d in dirnames if not d.startswith('.')]
+ dirnames[:] = [d for d in dirnames if not d.startswith('.') and not os.path.realpath(os.path.join(dirpath, d)) in visited]
return paths