fixed usage of catkin_find

This commit is contained in:
Dirk Thomas 2012-09-06 21:38:44 +00:00
parent 3e3001b3a7
commit 22dbf4e9e7
1 changed files with 4 additions and 3 deletions

View File

@ -492,10 +492,11 @@ def find_resource(pkg, resource_name, filter_fn=None, rospack=None):
# if found in binary dir, start with that. in any case, use matches # if found in binary dir, start with that. in any case, use matches
# from ros_package_path # from ros_package_path
matches = [] matches = []
for search_in in ['libexec', 'share']: for search_dirs in ['libexec', 'share']:
try: try:
search_path = catkin_find(search_in=[search_in], project=pkg) search_paths, _ = catkin_find(search_dirs=[search_dirs], project=pkg)
matches.extend(_find_resource(search_path, resource_name, filter_fn=filter_fn)) for search_path in search_paths:
matches.extend(_find_resource(search_path, resource_name, filter_fn=filter_fn))
except RuntimeError: except RuntimeError:
pass pass
matches.extend(_find_resource(pkg_path, resource_name, filter_fn=filter_fn)) matches.extend(_find_resource(pkg_path, resource_name, filter_fn=filter_fn))