Skip to content

Commit cc77100

Browse files
(tue-env) fix switching (#729)
Targets have been prepared, tue-robotics/tue-env-targets#441
2 parents a1cb1e8 + 5e0ed75 commit cc77100

13 files changed

+271
-167
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ This will rename the old targets folder with a timestamp and clone the new targe
7676

7777
#### Custom repository list
7878

79-
Various utility commands use `_tue-repos-do` to execute a command in all repositories. By default, this command will execute the command in all repositories in the `tue-env` workspace. This can be changed by setting the `TUE_REPOS_DO_DIRS` environment variable to a list of repositories folders. This can be done by adding the setting it with:
79+
Various utility commands use `_tue-repos-do` to execute a command in all repositories. By default, this command will execute the command in all repositories in the `tue-env` workspace. This can be changed by setting the `TUE_ENV_REPOS_DO_DIRS` environment variable to a list of repositories folders. This can be done by adding the setting it with:
8080

8181
```bash
82-
tue-env config [environment] set TUE_REPOS_DO_DIRS PATH1:PATH2:PATH3
82+
tue-env config [environment] set TUE_ENV_REPOS_DO_DIRS PATH1:PATH2:PATH3
8383
# Also possible to use variables in the paths, the variable needs to be single quoted
84-
tue-env config [environment] set TUE_REPOS_DO_DIRS '${TUE_REPOS_DIR}'/some/path:'${HOME}'some/other/path
84+
tue-env config [environment] set TUE_ENV_REPOS_DO_DIRS '${TUE_ENV_REPOS_DIR}'/some/path:'${HOME}'some/other/path
8585
```
8686

8787
#### Add an SSH key to GitHub to gain access to this repository
@@ -349,6 +349,7 @@ Add an APT source including the key which it is signed with.
349349
The use of the following variables is prohibited in `install.bash`:
350350

351351
- `TUE_APT_GET_UPDATED_FILE`
352+
- `TUE_ENV*`
352353
- `TUE_INSTALL_*`
353354
- `install_file`
354355
- `now`

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.26.0
1+
1.27.0

ci/build-package.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,29 +59,29 @@ then
5959
ADDITIONAL_ARGS_CATKIN+=("--verbose")
6060
fi
6161
echo -e "\e[35;1mCompile the package (catkin build ${ADDITIONAL_ARGS_CATKIN[*]} -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCATKIN_ENABLE_TESTING=OFF)\e[0m"
62-
docker exec -t tue-env bash -c 'source ~/.bashrc; cd "${TUE_SYSTEM_DIR}"/src/"${PACKAGE}" && /usr/bin/python3 "$(command -v catkin)" build --this --no-status '"${ADDITIONAL_ARGS_CATKIN[*]}"' -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCATKIN_ENABLE_TESTING=OFF'
62+
docker exec -t tue-env bash -c 'source ~/.bashrc; cd "${TUE_ENV_WS_DIR}"/src/"${PACKAGE}" && /usr/bin/python3 "$(command -v catkin)" build --this --no-status '"${ADDITIONAL_ARGS_CATKIN[*]}"' -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCATKIN_ENABLE_TESTING=OFF'
6363
else
6464
ADDITIONAL_ARGS_COLCON=()
6565
if [[ ${DEBUG} == "true" ]]
6666
then
6767
ADDITIONAL_ARGS_COLCON+=("--log-level" "debug")
6868
fi
6969
echo -e "\e[35;1mCheck for default mixin repo (colcon ${ADDITIONAL_ARGS_COLCON[*]} mixin list)\e[0m"
70-
MIXIN_REPOS=$(docker exec tue-env bash -c 'source ~/.bashrc; cd "${TUE_SYSTEM_DIR}" && colcon '"${ADDITIONAL_ARGS_COLCON[*]}"' mixin list | grep -v "^- "' | tr -d '\r' | awk -F ": " '{print $1}')
70+
MIXIN_REPOS=$(docker exec tue-env bash -c 'source ~/.bashrc; cd "${TUE_ENV_WS_DIR}" && colcon '"${ADDITIONAL_ARGS_COLCON[*]}"' mixin list | grep -v "^- "' | tr -d '\r' | awk -F ": " '{print $1}')
7171
if ! echo -e "${MIXIN_REPOS}" | grep "^default$" -q
7272
then
7373
echo -e "\e[35;1mAdd the default mixin repo (colcon ${ADDITIONAL_ARGS_COLCON[*]} mixin add default https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml)\e[0m"
74-
docker exec -t tue-env bash -c 'source ~/.bashrc; cd "${TUE_SYSTEM_DIR}" && colcon '"${ADDITIONAL_ARGS_COLCON[*]}"' mixin add default https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml'
74+
docker exec -t tue-env bash -c 'source ~/.bashrc; cd "${TUE_ENV_WS_DIR}" && colcon '"${ADDITIONAL_ARGS_COLCON[*]}"' mixin add default https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml'
7575
else
7676
echo -e "\e[35;1mDefault mixin repo already exists\e[0m"
7777
fi
7878

7979
echo -e "\e[35;1mUpdate colcon mixins (colcon ${ADDITIONAL_ARGS_COLCON[*]} mixin update)\e[0m"
80-
docker exec -t tue-env bash -c 'source ~/.bashrc; cd "${TUE_SYSTEM_DIR}" && colcon '"${ADDITIONAL_ARGS_COLCON[*]}"' mixin update'
80+
docker exec -t tue-env bash -c 'source ~/.bashrc; cd "${TUE_ENV_WS_DIR}" && colcon '"${ADDITIONAL_ARGS_COLCON[*]}"' mixin update'
8181

8282
echo -e "\e[35;1mDeleting the merged install directory\e[0m"
83-
docker exec -t tue-env bash -c 'source ~/.bashrc; cd "${TUE_SYSTEM_DIR}" && rm -rf install'
83+
docker exec -t tue-env bash -c 'source ~/.bashrc; cd "${TUE_ENV_WS_DIR}" && rm -rf install'
8484

8585
echo -e "\e[35;1mCompile the package (colcon ${ADDITIONAL_ARGS_COLCON[*]} build --mixin rel-with-deb-info build-testing-off)\e[0m"
86-
docker exec -t tue-env bash -c 'source ~/.bashrc; cd "${TUE_SYSTEM_DIR}" && colcon '"${ADDITIONAL_ARGS_COLCON[*]}"' build --packages-up-to "${PACKAGE}" --mixin rel-with-deb-info build-testing-off --event-handlers desktop_notification- status- terminal_title-'
86+
docker exec -t tue-env bash -c 'source ~/.bashrc; cd "${TUE_ENV_WS_DIR}" && colcon '"${ADDITIONAL_ARGS_COLCON[*]}"' build --packages-up-to "${PACKAGE}" --mixin rel-with-deb-info build-testing-off --event-handlers desktop_notification- status- terminal_title-'
8787
fi

ci/install-package.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ fi
248248
ROS_DISTRO=$(docker exec tue-env bash -c 'source ~/.bashrc; echo "${ROS_DISTRO}"' | tr -d '\r')
249249
echo -e "\e[35;1mROS_DISTRO = ${ROS_DISTRO}\e[0m"
250250

251-
TUE_SYSTEM_DIR=$(docker exec tue-env bash -c 'source ~/.bashrc; echo "${TUE_SYSTEM_DIR}"' | tr -d '\r')
251+
TUE_ENV_WS_DIR=$(docker exec tue-env bash -c 'source ~/.bashrc; echo "${TUE_ENV_WS_DIR}"' | tr -d '\r')
252252

253253
# First install only the git repo of the package so that appropriate branch can be checked out later
254254
echo -e "\e[35;1mtue-get install ros-${PACKAGE} --no-ros-deps ${ADDITIONAL_ARGS_TUE_GET[*]}\e[0m"
@@ -265,17 +265,17 @@ then
265265
# After a tue-get run, we checkout forced, just to be sure.
266266

267267
# Fetch the merged branch
268-
echo -e "\e[35;1mgit -C ~${TUE_SYSTEM_DIR#"${DOCKER_HOME}"}/src/${PACKAGE} fetch origin ${REF_NAME}/${PULL_REQUEST}/merge:PULLREQUEST\e[0m"
269-
docker exec -t tue-env bash -c 'source ~/.bashrc; git -C "$TUE_SYSTEM_DIR"/src/"$PACKAGE" fetch origin "$REF_NAME"/"$PULL_REQUEST"/merge:PULLREQUEST'
268+
echo -e "\e[35;1mgit -C ~${TUE_ENV_WS_DIR#"${DOCKER_HOME}"}/src/${PACKAGE} fetch origin ${REF_NAME}/${PULL_REQUEST}/merge:PULLREQUEST\e[0m"
269+
docker exec -t tue-env bash -c 'source ~/.bashrc; git -C "${TUE_ENV_WS_DIR}"/src/"${PACKAGE}" fetch origin "${REF_NAME}"/"${PULL_REQUEST}"/merge:PULLREQUEST'
270270

271271
# Install the package completely
272272
branch_string=${BRANCH:+" --try-branch=${BRANCH}"}
273273
echo -e "\e[35;1mtue-get install ros-${PACKAGE} --test-depend${branch_string} --try-branch=PULLREQUEST ${ADDITIONAL_ARGS_TUE_GET[*]}\e[0m"
274274
docker exec -t tue-env bash -c 'source ~/.bashrc; tue-get install ros-"${PACKAGE}" --test-depend --try-branch="${BRANCH}" --try-branch=PULLREQUEST '"${ADDITIONAL_ARGS_TUE_GET[*]}"
275275

276276
# Checkout -f to be really sure
277-
echo -e "\e[35;1mgit -C ~${TUE_SYSTEM_DIR#"${DOCKER_HOME}"}/src/${PACKAGE} checkout -f PULLREQUEST --\e[0m"
278-
docker exec -t tue-env bash -c 'source ~/.bashrc; git -C "$TUE_SYSTEM_DIR"/src/"$PACKAGE" checkout -f PULLREQUEST --'
277+
echo -e "\e[35;1mgit -C ~${TUE_ENV_WS_DIR#"${DOCKER_HOME}"}/src/${PACKAGE} checkout -f PULLREQUEST --\e[0m"
278+
docker exec -t tue-env bash -c 'source ~/.bashrc; git -C "${TUE_ENV_WS_DIR}"/src/"${PACKAGE}" checkout -f PULLREQUEST --'
279279
else
280280
# Install the package
281281
branch_string=${BRANCH:+" --try-branch=${BRANCH}"}
@@ -284,8 +284,8 @@ else
284284

285285
# Set the package to the right commit
286286
echo -e "\e[35;1mReset package to this commit\e[0m"
287-
echo -e "\e[35;1mgit -C ~${TUE_SYSTEM_DIR#"${DOCKER_HOME}"}/src/${PACKAGE} reset --hard ${COMMIT}\e[0m"
288-
docker exec -t tue-env bash -c 'source ~/.bashrc; git -C "${TUE_SYSTEM_DIR}"/src/"${PACKAGE}" reset --hard "${COMMIT}"'
287+
echo -e "\e[35;1mgit -C ~${TUE_ENV_WS_DIR#"${DOCKER_HOME}"}/src/${PACKAGE} reset --hard ${COMMIT}\e[0m"
288+
docker exec -t tue-env bash -c 'source ~/.bashrc; git -C "${TUE_ENV_WS_DIR}"/src/"${PACKAGE}" reset --hard "${COMMIT}"'
289289
fi
290290

291291
# Allow everyone to read ~/.cache/pip folder for caching inside CI pipelines

ci/test-package.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ then
5959
fi
6060
# Build test targets
6161
echo -e "\e[35;1mBuild test targets of this package (catkin build --this --no-deps ${CATKIN_ADDITIONAL_ARGS[*]} -DCATKIN_ENABLE_TESTING=ON)\e[0m"
62-
docker exec -t tue-env bash -c 'source ~/.bashrc; cd "${TUE_SYSTEM_DIR}"/src/"${PACKAGE}" && /usr/bin/python3 "$(command -v catkin)" build --this --no-status --no-deps '"${CATKIN_ADDITIONAL_ARGS[*]}"' -DCATKIN_ENABLE_TESTING=ON'
62+
docker exec -t tue-env bash -c 'source ~/.bashrc; cd "${TUE_ENV_WS_DIR}"/src/"${PACKAGE}" && /usr/bin/python3 "$(command -v catkin)" build --this --no-status --no-deps '"${CATKIN_ADDITIONAL_ARGS[*]}"' -DCATKIN_ENABLE_TESTING=ON'
6363

6464
# Run unit tests
6565
echo -e "\e[35;1mRun tests on this package (catkin test --this --no-deps ${CATKIN_ADDITIONAL_ARGS[*]} -DCATKIN_ENABLE_TESTING=ON)\e[0m"
66-
docker exec -t tue-env bash -c 'source ~/.bashrc; cd "${TUE_SYSTEM_DIR}"/src/"${PACKAGE}" && /usr/bin/python3 "$(command -v catkin)" test --this --no-status --no-deps '"${CATKIN_ADDITIONAL_ARGS[*]}"' -DCATKIN_ENABLE_TESTING=ON'
66+
docker exec -t tue-env bash -c 'source ~/.bashrc; cd "${TUE_ENV_WS_DIR}"/src/"${PACKAGE}" && /usr/bin/python3 "$(command -v catkin)" test --this --no-status --no-deps '"${CATKIN_ADDITIONAL_ARGS[*]}"' -DCATKIN_ENABLE_TESTING=ON'
6767
else
6868
COLCON_ADDITIONAL_ARGS=()
6969
if [[ ${DEBUG} == "true" ]]
@@ -72,13 +72,13 @@ else
7272
fi
7373
# Build test targets
7474
echo -e "\e[35;1mBuild test targets of this package (colcon ${COLCON_ADDITIONAL_ARGS[*]} build --packages-select ${PACKAGE} --mixin rel-with-deb-info build-testing-on)\e[0m"
75-
docker exec -t tue-env bash -c 'source ~/.bashrc; cd "${TUE_SYSTEM_DIR}" && colcon '"${COLCON_ADDITIONAL_ARGS[*]}"' build --packages-select "${PACKAGE}" --mixin rel-with-deb-info build-testing-on --event-handlers desktop_notification- status- terminal_title-'
75+
docker exec -t tue-env bash -c 'source ~/.bashrc; cd "${TUE_ENV_WS_DIR}" && colcon '"${COLCON_ADDITIONAL_ARGS[*]}"' build --packages-select "${PACKAGE}" --mixin rel-with-deb-info build-testing-on --event-handlers desktop_notification- status- terminal_title-'
7676

7777
# Run unit tests
7878
echo -e "\e[35;1mRun tests on this package (colcon ${COLCON_ADDITIONAL_ARGS[*]} test --packages-select ${PACKAGE} --executor sequential)\e[0m"
79-
docker exec -t tue-env bash -c 'source ~/.bashrc; cd "${TUE_SYSTEM_DIR}" && colcon '"${COLCON_ADDITIONAL_ARGS[*]}"' test --packages-select "${PACKAGE}" --executor sequential --event-handlers desktop_notification- status- terminal_title- console_cohesion+'
79+
docker exec -t tue-env bash -c 'source ~/.bashrc; cd "${TUE_ENV_WS_DIR}" && colcon '"${COLCON_ADDITIONAL_ARGS[*]}"' test --packages-select "${PACKAGE}" --executor sequential --event-handlers desktop_notification- status- terminal_title- console_cohesion+'
8080

8181
# Check test results
8282
echo -e "\e[35;1mCheck test results (colcon ${COLCON_ADDITIONAL_ARGS[*]} test-result --verbose)\e[0m"
83-
docker exec -t tue-env bash -c 'source ~/.bashrc; cd "${TUE_SYSTEM_DIR}" && colcon '"${COLCON_ADDITIONAL_ARGS[*]}"' test-result --verbose'
83+
docker exec -t tue-env bash -c 'source ~/.bashrc; cd "${TUE_ENV_WS_DIR}" && colcon '"${COLCON_ADDITIONAL_ARGS[*]}"' test-result --verbose'
8484
fi

installer/bootstrap.bash

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function main
8383
fi
8484

8585
# Initialize variables
86-
local create_venv targets_repo tue_ros_distro tue_ros_version venv_include_system_site
86+
local create_venv targets_repo tue_env_ros_distro tue_env_ros_version venv_include_system_site
8787

8888
# Default values
8989
create_venv="true"
@@ -113,36 +113,36 @@ function main
113113
"20.04")
114114
if [[ "${ros_version}" -eq 2 ]]
115115
then
116-
tue_ros_version=2
116+
tue_env_ros_version=2
117117
if [[ "${ros_distro}" == "foxy" ]]
118118
then
119-
tue_ros_distro="foxy"
119+
tue_env_ros_distro="foxy"
120120
elif [[ "${ros_distro}" == "galactic" ]]
121121
then
122-
tue_ros_distro="galactic"
122+
tue_env_ros_distro="galactic"
123123
elif [[ "${ros_distro}" == "rolling" ]]
124124
then
125-
tue_ros_distro="rolling"
125+
tue_env_ros_distro="rolling"
126126
elif [[ -n "${ros_distro}" ]]
127127
then
128128
echo "[tue-env](bootstrap) Error! ROS ${ros_distro} is unsupported with tue-env."
129129
return 1
130130
else
131-
tue_ros_distro="galactic"
132-
echo "[tue-env](bootstrap) Using default ROS_DISTRO '${tue_ros_distro}' with ROS_VERSION '${tue_ros_version}'"
131+
tue_env_ros_distro="galactic"
132+
echo "[tue-env](bootstrap) Using default ROS_DISTRO '${tue_env_ros_distro}' with ROS_VERSION '${tue_env_ros_version}'"
133133
fi
134134
elif [[ "${ros_version}" -eq 1 ]]
135135
then
136-
tue_ros_distro="noetic"
137-
tue_ros_version=1
136+
tue_env_ros_distro="noetic"
137+
tue_env_ros_version=1
138138
elif [[ -n "${ros_version}" ]]
139139
then
140140
echo "[tue-env](bootstrap) Error! ROS ${ros_version} is unsupported with tue-env."
141141
return 1
142142
else
143-
tue_ros_distro="noetic"
144-
tue_ros_version=1
145-
echo "[tue-env](bootstrap) Using default ROS_DISTRO '${tue_ros_distro}' with ROS_VERSION '${tue_ros_version}'"
143+
tue_env_ros_distro="noetic"
144+
tue_env_ros_version=1
145+
echo "[tue-env](bootstrap) Using default ROS_DISTRO '${tue_env_ros_distro}' with ROS_VERSION '${tue_env_ros_version}'"
146146
fi
147147
;;
148148
"22.04")
@@ -151,21 +151,21 @@ function main
151151
echo "[tue-env](bootstrap) Error! Only ROS version 2 is supported with ubuntu 22.04 and newer"
152152
return 1
153153
fi
154-
tue_ros_version=2
154+
tue_env_ros_version=2
155155

156156
if [[ "${ros_distro}" == "humble" ]]
157157
then
158-
tue_ros_distro="humble"
158+
tue_env_ros_distro="humble"
159159
elif [[ "${ros_distro}" == "rolling" ]]
160160
then
161-
tue_ros_distro="rolling"
161+
tue_env_ros_distro="rolling"
162162
elif [[ -n "${ros_distro}" ]]
163163
then
164164
echo "[tue-env](bootstrap) Error! ROS ${ros_distro} is unsupported with tue-env."
165165
return 1
166166
else
167-
tue_ros_distro="humble"
168-
echo "[tue-env](bootstrap) Using default ROS_DISTRO '${tue_ros_distro}' with ROS_VERSION '${tue_ros_version}'"
167+
tue_env_ros_distro="humble"
168+
echo "[tue-env](bootstrap) Using default ROS_DISTRO '${tue_env_ros_distro}' with ROS_VERSION '${tue_env_ros_version}'"
169169
fi
170170
;;
171171
"24.04")
@@ -174,21 +174,21 @@ function main
174174
echo "[tue-env](bootstrap) Error! Only ROS version 2 is supported with ubuntu 22.04 and newer"
175175
return 1
176176
fi
177-
tue_ros_version=2
177+
tue_env_ros_version=2
178178

179179
if [[ "${ros_distro}" == "jazzy" ]]
180180
then
181-
tue_ros_distro="jazzy"
181+
tue_env_ros_distro="jazzy"
182182
elif [[ "${ros_distro}" == "rolling" ]]
183183
then
184-
tue_ros_distro="rolling"
184+
tue_env_ros_distro="rolling"
185185
elif [[ -n "${ros_distro}" ]]
186186
then
187187
echo "[tue-env](bootstrap) Error! ROS ${ros_distro} is unsupported with tue-env."
188188
return 1
189189
else
190-
tue_ros_distro="jazzy"
191-
echo "[tue-env](bootstrap) Using default ROS_DISTRO '${tue_ros_distro}' with ROS_VERSION '${tue_ros_version}'"
190+
tue_env_ros_distro="jazzy"
191+
echo "[tue-env](bootstrap) Using default ROS_DISTRO '${tue_env_ros_distro}' with ROS_VERSION '${tue_env_ros_version}'"
192192
fi
193193
;;
194194
*)
@@ -203,8 +203,8 @@ function main
203203
{ [[ -n "${targets_repo}" ]] && env_targets_url="${targets_repo}"; } || env_targets_url="https://github.com/tue-robotics/tue-env-targets.git"
204204
[[ -n "${create_virtualenv}" ]] || create_virtualenv="true"
205205
env_dir="${HOME}/.tue"
206-
workspace="ros-${tue_ros_distro}"
207-
workspace_dir="${HOME}/ros/${tue_ros_distro}"
206+
workspace="ros-${tue_env_ros_distro}"
207+
workspace_dir="${HOME}/ros/${tue_env_ros_distro}"
208208

209209
# Move old environments and installer
210210
if [[ -d "${env_dir}" ]] && [[ -z "${CI}" ]]
@@ -269,8 +269,12 @@ function main
269269
"--targets-url=${env_targets_url}"
270270

271271
# Configure environment
272-
tue-env config "${workspace}" set "TUE_ROS_DISTRO" "${tue_ros_distro}"
273-
tue-env config "${workspace}" set "TUE_ROS_VERSION" "${tue_ros_version}"
272+
# TODO(anyone): Remove the use of TUE_XXX, when migration to TUE_ENV_XXX is complete
273+
tue-env config "${workspace}" set "TUE_ROS_DISTRO" "${tue_env_ros_distro}"
274+
tue-env config "${workspace}" set "TUE_ROS_VERSION" "${tue_env_ros_version}"
275+
276+
tue-env config "${workspace}" set "TUE_ENV_ROS_DISTRO" "${tue_env_ros_distro}"
277+
tue-env config "${workspace}" set "TUE_ENV_ROS_VERSION" "${tue_env_ros_version}"
274278

275279
# Add loading of TU/e tools (tue-env, tue-get, etc) to bashrc
276280
# shellcheck disable=SC2088

installer/generate_deb_control.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
TUE_ENV_TARGETS_DIR = os.environ["TUE_ENV_TARGETS_DIR"]
12-
TUE_ROS_DISTRO = os.environ["TUE_ROS_DISTRO"]
12+
TUE_ENV_ROS_DISTRO = os.environ["TUE_ENV_ROS_DISTRO"]
1313
ARCHITECTURES = {"x86_64": "amd64", "aarch64": "arm64"}
1414
CONTROL_FILE_TEMPLATE = """
1515
Package: {package}
@@ -55,7 +55,7 @@ def generate_control_file(path: str) -> Mapping:
5555
package = list(parsed["name"])[0]
5656
package = package.replace("_", "-")
5757
if "ament_cmake" in build_type:
58-
package = f"ros-{TUE_ROS_DISTRO}-{package}"
58+
package = f"ros-{TUE_ENV_ROS_DISTRO}-{package}"
5959

6060
control_file = CONTROL_FILE_TEMPLATE.format(
6161
package=package,

installer/parse_install_yaml.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,15 @@ def get_distro_item(
199199
return {"system_packages": system_packages, "commands": " ".join(commands)}
200200

201201
elif install_type == "ros" or install_type == "ros-remove-source":
202-
ros_release = environ["TUE_ROS_DISTRO"]
202+
# TODO(anyone): Remove the use of TUE_XXX, when migration to TUE_ENV_XXX is complete
203+
try:
204+
ros_release = environ["TUE_ENV_ROS_DISTRO"]
205+
except KeyError as e:
206+
try:
207+
ros_release = environ["TUE_ROS_DISTRO"]
208+
except KeyError:
209+
raise KeyError("TUE_ENV_ROS_DISTRO and TUE_ROS_DISTRO not set in environment variables")
210+
203211
try:
204212
source: Optional[Mapping[str, str]] = get_distro_item(install_item, "source", ros_release, "ROS")
205213
except ValueError as e:

installer/parse_package_xml.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def packagexml_parser(path: str) -> Mapping:
2727
fields = ["name", "version", "description", "maintainer", "export"]
2828
parsed = {}
2929

30-
if os.getenv("TUE_INSTALL_SKIP_ROS_DEPS", "false") == "false":
30+
if os.getenv("TUE_ENV_INSTALL_SKIP_ROS_DEPS", "false") == "false":
3131
dep_types.extend(
3232
[
3333
"build_depend",
@@ -40,10 +40,10 @@ def packagexml_parser(path: str) -> Mapping:
4040
]
4141
)
4242

43-
if os.getenv("TUE_INSTALL_TEST_DEPEND", "false") == "true":
43+
if os.getenv("TUE_ENV_INSTALL_TEST_DEPEND", "false") == "true":
4444
dep_types.append("test_depend")
4545

46-
if os.getenv("TUE_INSTALL_DOC_DEPEND", "false") == "true":
46+
if os.getenv("TUE_ENV_INSTALL_DOC_DEPEND", "false") == "true":
4747
dep_types.append("doc_depend")
4848

4949
for types in fields + dep_types:

0 commit comments

Comments
 (0)