public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH v2] linux-module: Obtain package names without version
@ 2021-04-08  9:53 Anton Mikanovich
  0 siblings, 0 replies; only message in thread
From: Anton Mikanovich @ 2021-04-08  9:53 UTC (permalink / raw)
  To: isar-users; +Cc: Anton Mikanovich

Add filtering out of package version for KERNEL_DEP variable.
This allow to obtain package names even in case of version syntax:
Depends: linux-headers-5.7.0-3-armmp (= 5.7.17-1)
Also use dpkg-query for Depends fetching without using grep.

This will fix following error when building example-module-armmp for
debian-bullseye:

dpkg-query: error: --listfiles needs a valid package name but
'(=' is not: illegal package name in specifier '(=': must start with an
alphanumeric character

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
 meta/recipes-kernel/linux-module/module.inc | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-kernel/linux-module/module.inc b/meta/recipes-kernel/linux-module/module.inc
index 47b9b71..0515621 100644
--- a/meta/recipes-kernel/linux-module/module.inc
+++ b/meta/recipes-kernel/linux-module/module.inc
@@ -39,9 +39,8 @@ dpkg_runbuild_prepend() {
                   grep "/lib/modules/.*/build")
     if [ -z "$KDIR" ]; then
         # Debian kernels install that folder indirectly via a dependency.
-        KERNEL_DEP=$(dpkg -s --root=${BUILDCHROOT_DIR} linux-headers-${KERNEL_NAME} | \
-                     grep "^Depends: .*linux-headers-" | \
-                     sed 's/.*\(linux-headers-[^,]*\).*/\1/')
+        KERNEL_DEP=$(dpkg-query -W -f '${Depends}' --admindir=${BUILDCHROOT_DIR}/var/lib/dpkg \
+                     linux-headers-${KERNEL_NAME} | sed 's/.*\(linux-headers-[[:graph:]]*\).*/\1/')
         export KDIR=$(dpkg -L --root=${BUILDCHROOT_DIR} ${KERNEL_DEP} | \
                       grep "/lib/modules/.*/build")
     fi
-- 
2.20.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-08  9:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-08  9:53 [PATCH v2] linux-module: Obtain package names without version Anton Mikanovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox