Skip to content

Commit a9702c9

Browse files
committed
Update ldd|awk to account for Bookworm's merged /usr
1 parent 7f99010 commit a9702c9

File tree

10 files changed

+20
-20
lines changed

10 files changed

+20
-20
lines changed

16/bookworm-slim/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
4242
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
4343
&& apt-mark auto '.*' > /dev/null \
4444
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
45-
| awk '/=>/ { print $(NF-1) }' \
45+
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
4646
| sort -u \
4747
| xargs -r dpkg-query --search \
4848
| cut -d: -f1 \
@@ -77,7 +77,7 @@ RUN set -ex \
7777
&& apt-mark auto '.*' > /dev/null \
7878
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; } \
7979
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
80-
| awk '/=>/ { print $(NF-1) }' \
80+
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
8181
| sort -u \
8282
| xargs -r dpkg-query --search \
8383
| cut -d: -f1 \

16/bullseye-slim/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
4242
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
4343
&& apt-mark auto '.*' > /dev/null \
4444
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
45-
| awk '/=>/ { print $(NF-1) }' \
45+
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
4646
| sort -u \
4747
| xargs -r dpkg-query --search \
4848
| cut -d: -f1 \
@@ -77,7 +77,7 @@ RUN set -ex \
7777
&& apt-mark auto '.*' > /dev/null \
7878
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; } \
7979
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
80-
| awk '/=>/ { print $(NF-1) }' \
80+
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
8181
| sort -u \
8282
| xargs -r dpkg-query --search \
8383
| cut -d: -f1 \

16/buster-slim/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
4242
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
4343
&& apt-mark auto '.*' > /dev/null \
4444
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
45-
| awk '/=>/ { print $(NF-1) }' \
45+
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
4646
| sort -u \
4747
| xargs -r dpkg-query --search \
4848
| cut -d: -f1 \
@@ -77,7 +77,7 @@ RUN set -ex \
7777
&& apt-mark auto '.*' > /dev/null \
7878
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; } \
7979
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
80-
| awk '/=>/ { print $(NF-1) }' \
80+
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
8181
| sort -u \
8282
| xargs -r dpkg-query --search \
8383
| cut -d: -f1 \

18/bookworm-slim/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
4242
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
4343
&& apt-mark auto '.*' > /dev/null \
4444
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
45-
| awk '/=>/ { print $(NF-1) }' \
45+
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
4646
| sort -u \
4747
| xargs -r dpkg-query --search \
4848
| cut -d: -f1 \
@@ -77,7 +77,7 @@ RUN set -ex \
7777
&& apt-mark auto '.*' > /dev/null \
7878
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; } \
7979
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
80-
| awk '/=>/ { print $(NF-1) }' \
80+
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
8181
| sort -u \
8282
| xargs -r dpkg-query --search \
8383
| cut -d: -f1 \

18/bullseye-slim/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
4242
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
4343
&& apt-mark auto '.*' > /dev/null \
4444
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
45-
| awk '/=>/ { print $(NF-1) }' \
45+
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
4646
| sort -u \
4747
| xargs -r dpkg-query --search \
4848
| cut -d: -f1 \
@@ -77,7 +77,7 @@ RUN set -ex \
7777
&& apt-mark auto '.*' > /dev/null \
7878
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; } \
7979
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
80-
| awk '/=>/ { print $(NF-1) }' \
80+
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
8181
| sort -u \
8282
| xargs -r dpkg-query --search \
8383
| cut -d: -f1 \

18/buster-slim/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
4242
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
4343
&& apt-mark auto '.*' > /dev/null \
4444
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
45-
| awk '/=>/ { print $(NF-1) }' \
45+
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
4646
| sort -u \
4747
| xargs -r dpkg-query --search \
4848
| cut -d: -f1 \
@@ -77,7 +77,7 @@ RUN set -ex \
7777
&& apt-mark auto '.*' > /dev/null \
7878
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; } \
7979
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
80-
| awk '/=>/ { print $(NF-1) }' \
80+
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
8181
| sort -u \
8282
| xargs -r dpkg-query --search \
8383
| cut -d: -f1 \

20/bookworm-slim/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
4242
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
4343
&& apt-mark auto '.*' > /dev/null \
4444
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
45-
| awk '/=>/ { print $(NF-1) }' \
45+
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
4646
| sort -u \
4747
| xargs -r dpkg-query --search \
4848
| cut -d: -f1 \
@@ -77,7 +77,7 @@ RUN set -ex \
7777
&& apt-mark auto '.*' > /dev/null \
7878
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; } \
7979
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
80-
| awk '/=>/ { print $(NF-1) }' \
80+
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
8181
| sort -u \
8282
| xargs -r dpkg-query --search \
8383
| cut -d: -f1 \

20/bullseye-slim/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
4242
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
4343
&& apt-mark auto '.*' > /dev/null \
4444
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
45-
| awk '/=>/ { print $(NF-1) }' \
45+
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
4646
| sort -u \
4747
| xargs -r dpkg-query --search \
4848
| cut -d: -f1 \
@@ -77,7 +77,7 @@ RUN set -ex \
7777
&& apt-mark auto '.*' > /dev/null \
7878
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; } \
7979
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
80-
| awk '/=>/ { print $(NF-1) }' \
80+
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
8181
| sort -u \
8282
| xargs -r dpkg-query --search \
8383
| cut -d: -f1 \

20/buster-slim/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
4242
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
4343
&& apt-mark auto '.*' > /dev/null \
4444
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
45-
| awk '/=>/ { print $(NF-1) }' \
45+
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
4646
| sort -u \
4747
| xargs -r dpkg-query --search \
4848
| cut -d: -f1 \
@@ -77,7 +77,7 @@ RUN set -ex \
7777
&& apt-mark auto '.*' > /dev/null \
7878
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; } \
7979
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
80-
| awk '/=>/ { print $(NF-1) }' \
80+
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
8181
| sort -u \
8282
| xargs -r dpkg-query --search \
8383
| cut -d: -f1 \

Dockerfile-slim.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
3333
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
3434
&& apt-mark auto '.*' > /dev/null \
3535
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
36-
| awk '/=>/ { print $(NF-1) }' \
36+
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
3737
| sort -u \
3838
| xargs -r dpkg-query --search \
3939
| cut -d: -f1 \
@@ -68,7 +68,7 @@ RUN set -ex \
6868
&& apt-mark auto '.*' > /dev/null \
6969
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; } \
7070
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
71-
| awk '/=>/ { print $(NF-1) }' \
71+
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
7272
| sort -u \
7373
| xargs -r dpkg-query --search \
7474
| cut -d: -f1 \

0 commit comments

Comments
 (0)