Skip to content

Commit

Permalink
Support ROS_DISTRO=false fully
Browse files Browse the repository at this point in the history
  • Loading branch information
mathias-luedtke committed Jun 6, 2023
1 parent afbf77f commit a6e1f7c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 0 additions & 2 deletions industrial_ci/src/isolation/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ function ici_isolate() {

if [ -z "${ROS_DISTRO:-}" ]; then
ROS_DISTRO=$(docker image inspect --format "{{.Config.Env}}" "${DOCKER_IMAGE}" | grep -o -P "(?<=ROS_DISTRO=)[a-z]*") || ici_error "ROS_DISTRO is not set"
elif [ "${ROS_DISTRO}" = "false" ]; then
unset ROS_DISTRO
fi

ici_forward_mount TARGET_REPO_PATH ro
Expand Down
3 changes: 2 additions & 1 deletion industrial_ci/src/ros.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ function _set_ros_defaults {
_ros2_defaults "jammy"
;;
"false")
unset ROS_DISTRO
export BUILDER=${BUILDER:-colcon}
export ROS_PYTHON_VERSION=${ROS_PYTHON_VERSION:-3}
;;
*)
ici_error "ROS_DISTRO '$ROS_DISTRO' is not supported"
Expand Down
6 changes: 3 additions & 3 deletions industrial_ci/src/workspace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function ici_init_apt {
ici_apt_install "${debs_default[@]}"
fi

if [ -n "$ROS_DISTRO" ]; then
if [ -n "$ROS_DISTRO" ] && [ "$ROS_DISTRO" != false ]; then
local current_repository_path
current_repository_path="$(apt-cache policy "ros-$ROS_DISTRO-ros-core" 2> /dev/null | grep -Eo "[^ ]+://[^ ]+")" || true
ici_set_ros_repository_path "$current_repository_path"
Expand Down Expand Up @@ -322,7 +322,7 @@ function ici_setup_rosdep {

if [ "$ROS_DISTRO" = "indigo" ] || [ "$ROS_DISTRO" = "jade" ]; then
ici_apt_install "ros-$ROS_DISTRO-roslib"
else
elif [ "$ROS_DISTRO" != false ]; then
ici_apt_install "ros-$ROS_DISTRO-ros-environment"
fi

Expand All @@ -334,7 +334,7 @@ function ici_setup_rosdep {
fi

update_opts=()
if [ -z "${ROSDISTRO_INDEX_URL:-}" ]; then
if [ -z "${ROSDISTRO_INDEX_URL:-}" ] && [ "$ROS_DISTRO" != false ]; then
update_opts+=(--rosdistro "$ROS_DISTRO")
fi
if [ "$ROS_VERSION_EOL" = true ]; then
Expand Down

0 comments on commit a6e1f7c

Please sign in to comment.