From cf1038bd2026a9b97187fb71349cbdb5ab02dbf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20L=C3=BCdtke?= <727227+mathias-luedtke@users.noreply.github.com> Date: Fri, 29 Mar 2024 15:30:13 +0100 Subject: [PATCH] Migrate ROSDEP_SOURCES_VERSION to ROSDISTRO_INDEX_VERSION --- doc/index.rst | 4 ++-- industrial_ci/src/deprecated.sh | 1 + industrial_ci/src/env.sh | 2 +- industrial_ci/src/isolation/docker.env | 2 +- industrial_ci/src/ros.sh | 2 +- industrial_ci/src/workspace.sh | 12 ++++++++---- 6 files changed, 14 insertions(+), 9 deletions(-) diff --git a/doc/index.rst b/doc/index.rst index 37fa8ae6e..209387bb5 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -214,11 +214,11 @@ Note that some of these currently tied only to a single option, but we still lea * **ROS_REPOSITORY_KEY** (default: not set): Location of ROS' binary repository key; either as URL, file path or fingerprint. * **ROS_REPOSITORY_PATH**: Location of ROS' binary repositories where depended packages get installed from (typically both standard repo (``http://packages.ros.org/ros/ubuntu``) and `"Shadow-Fixed" repository `__ (``http://packages.ros.org/ros-shadow-fixed/ubuntu``)). Since version 0.3.4, ``ROS_REPO`` is recommended, and ``ROS_REPOSITORY_PATH`` is for more intermediate usage only (e.g. to specify your own binary repository (non-standard / in house)). Backward compatibility is preserved. * **ROSDEP_SKIP_KEYS** (default: not set): space-separated list of keys that should get skipped by ``rosdep install``. -* **ROSDEP_SOURCES_VERSION** (default: not set): If set, patch the files in /etc/ros/rosdep/sources.list.d/*.list to use this version instead of master. +* **ROSDISTRO_INDEX_VERSION** (default: not set): If set, patch the files in /etc/ros/rosdep/sources.list.d/*.list to use this version instead of master and set ROSDISTRO_INDEX_URL accordingly * **ROSINSTALL_FILENAME** (*deprecated*, default: ``.travis.rosinstall``): Only used when ``UPSTREAM_WORKSPACE`` is set to ``file``. See ``UPSTREAM_WORKSPACE`` description. * **PYLINT_ARGS** (default: not set): pass command line arguments to ``pylint`` command (e.g. ``--output-format=parseable --errors-only``) - can e.g. be used to ``ignore_modules`` * **PYLINT_CHECK** (default: false): If ``true``, run ``pylint`` checks -* **PYLINT_EXCLUDE** (default: not set): Pattern that can be used to exclude files via the ``-not -path`` filter. +* **PYLINT_EXCLUDE** (default: not set): Pattern that can be used to exclude files via the ``-not -path`` filter. * **TARGET_CMAKE_ARGS** (default: not set): Addtional CMake arguments for target `workspace <#workspace-management>`__. * **TARGET_WORKSPACE** (default: ``$TARGET_REPO_PATH``): Definition of sources for target `workspace <#workspace-management>`__. * **UNDERLAY** (default: not set): Path to an install space (instead of ``/opt/ros/$ROS_DISTRO``) to be used as an underlay of the workspaces being set up be ICI, e.g. a workspace provided by a custom docker image diff --git a/industrial_ci/src/deprecated.sh b/industrial_ci/src/deprecated.sh index d4b16b2ab..19334a439 100644 --- a/industrial_ci/src/deprecated.sh +++ b/industrial_ci/src/deprecated.sh @@ -95,3 +95,4 @@ ici_mark_deprecated DOCKER_COMMIT_CREDENTIALS "Credentials will be copied, but n ici_rename_deprecated HASHKEY_SKS ROS_REPOSITORY_KEY ici_rename_deprecated APTKEY_STORE_HTTPS ROS_REPOSITORY_KEY +ici_rename_deprecated ROSDEP_SOURCES_VERSION ROSDISTRO_INDEX_VERSION diff --git a/industrial_ci/src/env.sh b/industrial_ci/src/env.sh index 454316270..81fe7f203 100644 --- a/industrial_ci/src/env.sh +++ b/industrial_ci/src/env.sh @@ -21,6 +21,7 @@ export ROS_DISTRO=${ROS_DISTRO:-} export ROS_REPOSITORY_PATH=${ROS_REPOSITORY_PATH:-} export ROS_REPO=${ROS_REPO:-} export ROS_REPOSITORY_KEY=${ROS_REPOSITORY_KEY:-"$ICI_SRC_PATH/keys/ros.asc"} +export ROSDISTRO_INDEX_VERSION=${ROSDISTRO_INDEX_VERSION:-} export DEBUG_BASH=${DEBUG_BASH:-false} export TEST=${TEST:-} @@ -81,7 +82,6 @@ case "${OS_CODE_NAME-}" in esac export ROSDEP_SKIP_KEYS=${ROSDEP_SKIP_KEYS:-} -export ROSDEP_SOURCES_VERSION=${ROSDEP_SOURCES_VERSION:-} export TARGET_CMAKE_ARGS=${TARGET_CMAKE_ARGS:-} export UPSTREAM_CMAKE_ARGS=${UPSTREAM_CMAKE_ARGS:-} diff --git a/industrial_ci/src/isolation/docker.env b/industrial_ci/src/isolation/docker.env index f7ddbd7be..6215bcc86 100644 --- a/industrial_ci/src/isolation/docker.env +++ b/industrial_ci/src/isolation/docker.env @@ -38,7 +38,7 @@ PYLINT_CHECK PYLINT_EXCLUDE PYTHONUNBUFFERED ROSDEP_SKIP_KEYS -ROSDEP_SOURCES_VERSION +ROSDISTRO_INDEX_VERSION ROSINSTALL_FILENAME ROS_DISTRO ROS_PYTHON_VERSION diff --git a/industrial_ci/src/ros.sh b/industrial_ci/src/ros.sh index 16c35fb42..0077c42bb 100644 --- a/industrial_ci/src/ros.sh +++ b/industrial_ci/src/ros.sh @@ -38,7 +38,7 @@ function _ros2_defaults { function _ros_is_eol { export ROS_VERSION_EOL=true - export ROSDEP_SOURCES_VERSION=${ROSDEP_SOURCES_VERSION:-$1} + export ROSDISTRO_INDEX_VERSION=${ROSDISTRO_INDEX_VERSION:-$1} } function _set_ros_defaults { diff --git a/industrial_ci/src/workspace.sh b/industrial_ci/src/workspace.sh index a2d156ef7..3eb836292 100644 --- a/industrial_ci/src/workspace.sh +++ b/industrial_ci/src/workspace.sh @@ -329,14 +329,18 @@ function ici_setup_rosdep { if ! [ -d /etc/ros/rosdep/sources.list.d ]; then ici_cmd ici_quiet ici_asroot rosdep init fi - if [ -n "$ROSDEP_SOURCES_VERSION" ]; then - ici_cmd ici_quiet ici_asroot sed -E -i "s;(https://raw.githubusercontent.com/ros/rosdistro/)master;\1$ROSDEP_SOURCES_VERSION;g" /etc/ros/rosdep/sources.list.d/*.list - fi - update_opts=() if [ -z "${ROSDISTRO_INDEX_URL:-}" ]; then update_opts+=(--rosdistro "$ROS_DISTRO") fi + + if [ -n "$ROSDISTRO_INDEX_VERSION" ]; then + if [ -z "${ROSDISTRO_INDEX_URL:-}" ]; then + export ROSDISTRO_INDEX_URL=https://raw.githubusercontent.com/ros/rosdistro/$ROSDISTRO_INDEX_VERSION/index-v4.yaml + fi + ici_cmd ici_quiet ici_asroot sed -E -i "s;(https://raw.githubusercontent.com/ros/rosdistro/)master;\1$ROSDISTRO_INDEX_VERSION;g" /etc/ros/rosdep/sources.list.d/*.list + fi + if [ "$ROS_VERSION_EOL" = true ]; then update_opts+=(--include-eol-distros) fi