public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] linux-module: Obtain package names without version
@ 2021-04-02 12:05 Anton Mikanovich
  2021-04-06  7:10 ` Henning Schild
  0 siblings, 1 reply; 3+ messages in thread
From: Anton Mikanovich @ 2021-04-02 12:05 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)

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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-kernel/linux-module/module.inc b/meta/recipes-kernel/linux-module/module.inc
index 47b9b71..419786b 100644
--- a/meta/recipes-kernel/linux-module/module.inc
+++ b/meta/recipes-kernel/linux-module/module.inc
@@ -41,7 +41,8 @@ dpkg_runbuild_prepend() {
         # 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/')
+                     sed 's/.*\(linux-headers-[^,]*\).*/\1/' | \
+                     sed 's/([^)]*)//g')
         export KDIR=$(dpkg -L --root=${BUILDCHROOT_DIR} ${KERNEL_DEP} | \
                       grep "/lib/modules/.*/build")
     fi
-- 
2.20.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] linux-module: Obtain package names without version
  2021-04-02 12:05 [PATCH] linux-module: Obtain package names without version Anton Mikanovich
@ 2021-04-06  7:10 ` Henning Schild
  2021-04-08  9:48   ` Anton Mikanovich
  0 siblings, 1 reply; 3+ messages in thread
From: Henning Schild @ 2021-04-06  7:10 UTC (permalink / raw)
  To: Anton Mikanovich; +Cc: isar-users

Am Fri,  2 Apr 2021 15:05:45 +0300
schrieb Anton Mikanovich <amikan@ilbers.de>:

> 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)
> 
> 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 | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-kernel/linux-module/module.inc
> b/meta/recipes-kernel/linux-module/module.inc index 47b9b71..419786b
> 100644 --- a/meta/recipes-kernel/linux-module/module.inc
> +++ b/meta/recipes-kernel/linux-module/module.inc
> @@ -41,7 +41,8 @@ dpkg_runbuild_prepend() {
>          # Debian kernels install that folder indirectly via a
> dependency. KERNEL_DEP=$(dpkg -s --root=${BUILDCHROOT_DIR}
> linux-headers-${KERNEL_NAME} | \ grep "^Depends: .*linux-headers-" | \

dpkg-query -W -f '${Depends}' linux-headers-${KERNEL_NAME}

> -                     sed 's/.*\(linux-headers-[^,]*\).*/\1/')
> +                     sed 's/.*\(linux-headers-[^,]*\).*/\1/' | \
> +                     sed 's/([^)]*)//g')
>          export KDIR=$(dpkg -L --root=${BUILDCHROOT_DIR}
> ${KERNEL_DEP} | \ grep "/lib/modules/.*/build")
>      fi


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] linux-module: Obtain package names without version
  2021-04-06  7:10 ` Henning Schild
@ 2021-04-08  9:48   ` Anton Mikanovich
  0 siblings, 0 replies; 3+ messages in thread
From: Anton Mikanovich @ 2021-04-08  9:48 UTC (permalink / raw)
  To: Henning Schild; +Cc: isar-users

06.04.2021 10:10, Henning Schild wrote:
> dpkg-query -W -f '${Depends}' linux-headers-${KERNEL_NAME}

dpkg-query will not filter out version, but at least can get rid of grep.
Will send v2, thanks.

-- 
Anton Mikanovich
Promwad Ltd.
External service provider of ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn, Germany
+49 (89) 122 67 24-0
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-08  9:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-02 12:05 [PATCH] linux-module: Obtain package names without version Anton Mikanovich
2021-04-06  7:10 ` Henning Schild
2021-04-08  9:48   ` Anton Mikanovich

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