fix resource location rule for build environment

This commit is contained in:
Brian Gerkey 2012-01-07 22:10:06 +00:00
parent e62f78bfd5
commit 8af58830e4
1 changed files with 6 additions and 7 deletions

View File

@ -526,11 +526,10 @@ def find_resource(pkg, resource_name, filter_fn=None, rospack=None, catkin_packa
if CATKIN_BINARY_DIR in os.environ and not catkin_packages_cache:
_load_catkin_packages_cache(catkin_packages_cache)
# return matches from binary dir if found, otherwise ROS_PACKAGE_PATH
# if found in binary dir, start with that. in any case, use matches
# from ros_package_path
matches = []
if pkg in catkin_packages_cache:
matches = _find_resource(catkin_packages_cache[pkg], resource_name)
if matches:
return matches
else:
return _find_resource(pkg_path, resource_name)
matches.extend(_find_resource(catkin_packages_cache[pkg], resource_name))
matches.extend(_find_resource(pkg_path, resource_name))
return matches