From 8508f4b565116fb0fa338b124848768453026c68 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Fri, 5 Apr 2024 14:51:55 -0700 Subject: [PATCH] Fix `dpkg-query --search` to be more specific --- 1/debian/Dockerfile | 2 +- Dockerfile.template | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/1/debian/Dockerfile b/1/debian/Dockerfile index 1705e8c..02a922d 100644 --- a/1/debian/Dockerfile +++ b/1/debian/Dockerfile @@ -74,7 +74,7 @@ RUN set -eux; \ apt-mark auto '.*' > /dev/null; \ apt-mark manual $savedAptMark > /dev/null; \ find /usr/local -type f -executable -exec ldd '{}' ';' \ - | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ | sort -u \ | xargs -r dpkg-query --search \ | cut -d: -f1 \ diff --git a/Dockerfile.template b/Dockerfile.template index 2edbccd..e509d4b 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -115,7 +115,7 @@ RUN set -eux; \ apt-mark auto '.*' > /dev/null; \ apt-mark manual $savedAptMark > /dev/null; \ find /usr/local -type f -executable -exec ldd '{}' ';' \ - | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ | sort -u \ | xargs -r dpkg-query --search \ | cut -d: -f1 \