From c707661de02668f69bdfe42b2e5ebce87e6a68d2 Mon Sep 17 00:00:00 2001 From: Naophis Date: Mon, 3 Jun 2024 17:12:09 +0900 Subject: [PATCH] chore: hold check of plotjuggler-ros package and display warning if held (#4805) * chore: Hold check of plotjuggler-ros package and display warning if held Signed-off-by: Naophis * chore: fix condition for checking held ROS package in dev_tools role Signed-off-by: Naophis * style(pre-commit): autofix * chore: Update dev_tools role to fix condition for checking held ROS package Signed-off-by: Naophis --------- Signed-off-by: Naophis Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- ansible/roles/dev_tools/tasks/main.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ansible/roles/dev_tools/tasks/main.yaml b/ansible/roles/dev_tools/tasks/main.yaml index 2a11dd7ffc6..1a7d3c6511a 100644 --- a/ansible/roles/dev_tools/tasks/main.yaml +++ b/ansible/roles/dev_tools/tasks/main.yaml @@ -37,6 +37,11 @@ state: latest update_cache: true +- name: Hold check of ros-{{ rosdistro + '-plotjuggler-ros' }} + ansible.builtin.command: apt-mark showhold + register: held_ros_packages + changed_when: false + - name: Install plotjuggler become: true ansible.builtin.apt: @@ -44,3 +49,11 @@ - ros-{{ rosdistro }}-plotjuggler-ros state: latest update_cache: true + when: "'ros-' + rosdistro + '-plotjuggler-ros' not in held_ros_packages.stdout" + register: install_result + failed_when: false + +- name: Display warning if plotjuggler-ros package is held + ansible.builtin.debug: + msg: ROS package 'ros-{{ rosdistro }}-plotjuggler-ros' is apt-mark hold. Skipping installation. + when: not install_result.changed