add --first-only option to catkin_find invocation to be defensive (#83)

This commit is contained in:
Dirk Thomas 2015-06-09 10:31:17 -07:00
parent a475c05831
commit bd49938705
2 changed files with 3 additions and 3 deletions

View File

@ -233,7 +233,7 @@ function rosls {
function _roscmd {
local pkgdir exepath opt catkin_package_libexec_dir opts
if [[ -n $CMAKE_PREFIX_PATH ]]; then
catkin_package_libexec_dir=`catkin_find --without-underlays --libexec $1 2> /dev/null`
catkin_package_libexec_dir=`catkin_find --first-only --without-underlays --libexec $1 2> /dev/null`
fi
pkgdir=`_ros_package_find $1`
if [[ -z $catkin_package_libexec_dir && -z $pkgdir ]]; then
@ -435,7 +435,7 @@ function _roscomplete_find {
local pkg=${2}
local arg=${3}
if [[ -n $CMAKE_PREFIX_PATH ]]; then
catkin_package_libexec_dir=`catkin_find --without-underlays --libexec ${pkg} 2> /dev/null`
catkin_package_libexec_dir=`catkin_find --first-only --without-underlays --libexec ${pkg} 2> /dev/null`
fi
pkgdir=`_ros_package_find ${pkg}`
if [[ -n "$catkin_package_libexec_dir" || -n "$pkgdir" ]]; then

View File

@ -318,7 +318,7 @@ function _roscomplete_search_dir {
fi
pkgdir=`export ROS_CACHE_TIMEOUT=-1.0 && rospack find ${pkg} 2> /dev/null`
pkgdir_result=$?
catkin_package_libexec_dir=`catkin_find --without-underlays --libexec ${pkg} 2> /dev/null`
catkin_package_libexec_dir=`catkin_find --first-only --without-underlays --libexec ${pkg} 2> /dev/null`
if [[ $? != 0 ]]
then
catkin_package_libexec_dir=""