appliance: Fix searching for shared libraries on usr-merged Debian systems
authorHilko Bengen <bengen@debian.org>
Tue, 31 Aug 2021 15:00:10 +0000 (17:00 +0200)
committerHilko Bengen <bengen@debian.org>
Tue, 31 Aug 2021 15:02:19 +0000 (16:02 +0100)
If /lib is a symlink to usr/lib, paths to shared libraries as
determined by ld.so may differ from dpkg's file lists.

We turn the filename search pattern into a glob expression by
prefixing it with a '*', so the required packages are found again:

$ dpkg -S /lib/x86_64-linux-gnu/libpcre2-8.so.0
dpkg-query: no path found matching pattern /lib/x86_64-linux-gnu/libpcre2-8.so.0
$ dpkg -S */lib/x86_64-linux-gnu/libpcre2-8.so.0
libpcre2-8-0:amd64: /usr/lib/x86_64-linux-gnu/libpcre2-8.so.0

Gbp-Pq: Name 0021-appliance-Fix-searching-for-shared-libraries-on-usr-.patch

appliance/Makefile.am

index ceecf7aaeccab34217c946dd3e5f71a52b973d90..88fec6c0f6ca966f5ef90ee7fa5c6ff18e3d8b78 100644 (file)
@@ -85,7 +85,7 @@ if HAVE_RPM
 QUERY_FILES_CMD := xargs rpm -qf --qf '%{name}\n'
 endif
 if HAVE_DPKG
-QUERY_FILES_CMD := xargs dpkg -S | cut -d: -f1
+QUERY_FILES_CMD := sed -e 's,^/,\*/,' | xargs dpkg -S | cut -d: -f1
 endif
 if HAVE_PACMAN
 QUERY_FILES_CMD := xargs pacman -Qo | sed -r 's/.* is owned by ([^ ]+) .*/\1/'