From a6ee82478cbccc81615ebb4a90320b3eac562c99 Mon Sep 17 00:00:00 2001 From: Tully Foote Date: Fri, 24 Jan 2025 11:13:39 -0800 Subject: [PATCH] Update detection to check specifically for installation status not just presence in the database. This was providing a false positive if the package was in the apt-cache but in 'uninstalled' state, and on the other side a false negative if the package wasn't in the cache. --- src/rocker/templates/rmw_snippet.Dockerfile.em | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rocker/templates/rmw_snippet.Dockerfile.em b/src/rocker/templates/rmw_snippet.Dockerfile.em index 87f50275..53007d3a 100644 --- a/src/rocker/templates/rmw_snippet.Dockerfile.em +++ b/src/rocker/templates/rmw_snippet.Dockerfile.em @@ -4,7 +4,7 @@ @[ if rmw ]@ RUN \ if [ -z "${ROS_DISTRO}" ]; then echo "ROS_DISTRO is unset cannot override RMW" ; exit 1 ; fi ;\ - if dpkg -l @(' '.join(packages)) > /dev/null 2>&1; then \ + if ! dpkg -l @(' '.join(packages)) | grep -q ^ii ; then \ apt-get update \ && DEBIAN_FRONTENT=non-interactive apt-get install -qy --no-install-recommends\ @(' '.join(packages)) \