[PATCH 1/1] dpkg-prebuilt: ensure fetched packages are valid debian packages

7 views
Skip to first unread message

Felix Moessbauer

unread,
Jun 26, 2024, 7:06:02 AM (10 days ago) Jun 26
to isar-...@googlegroups.com, adriaan...@siemens.com, Felix Moessbauer
In case of dpkg-prebuilt, we need to check if the fetched packages are
valid debian packages to only deploy valid ones into the sstate cache.
Otherwise broken packages might end up in the cache and break future
builds.

Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
---
meta/classes/dpkg-prebuilt.bbclass | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/classes/dpkg-prebuilt.bbclass b/meta/classes/dpkg-prebuilt.bbclass
index 7092670b..c6b66c62 100644
--- a/meta/classes/dpkg-prebuilt.bbclass
+++ b/meta/classes/dpkg-prebuilt.bbclass
@@ -19,5 +19,8 @@ python do_unpack:prepend() {
# also breaks inherited (from dpkg-base) dependency on sbuild_chroot
do_dpkg_build[depends] = "${PN}:do_unpack"
do_dpkg_build() {
- true
+ # ensure all packages we got are valid debian packages
+ if [ -n "$(find ${WORKDIR} -maxdepth 1 -name '*.deb' -print -quit)" ]; then
+ dpkg -I ${WORKDIR}/*.deb
+ fi
}
--
2.39.2

MOESSBAUER, Felix

unread,
Jun 26, 2024, 9:22:34 AM (10 days ago) Jun 26
to isar-...@googlegroups.com, Schmidt, Adriaan
On Wed, 2024-06-26 at 13:05 +0200, Felix Moessbauer wrote:
> In case of dpkg-prebuilt, we need to check if the fetched packages
> are
> valid debian packages to only deploy valid ones into the sstate
> cache.
> Otherwise broken packages might end up in the cache and break future
> builds.

This does not work in case we deploy multiple debs. Will fix this in a
v2 after testing.

Felix

>
> Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
> ---
>  meta/classes/dpkg-prebuilt.bbclass | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes/dpkg-prebuilt.bbclass b/meta/classes/dpkg-
> prebuilt.bbclass
> index 7092670b..c6b66c62 100644
> --- a/meta/classes/dpkg-prebuilt.bbclass
> +++ b/meta/classes/dpkg-prebuilt.bbclass
> @@ -19,5 +19,8 @@ python do_unpack:prepend() {
>  # also breaks inherited (from dpkg-base) dependency on sbuild_chroot
>  do_dpkg_build[depends] = "${PN}:do_unpack"
>  do_dpkg_build() {
> -    true
> +    # ensure all packages we got are valid debian packages
> +    if [ -n "$(find ${WORKDIR} -maxdepth 1 -name '*.deb' -print -
> quit)" ]; then
> +        dpkg -I ${WORKDIR}/*.deb
> +    fi
>  }

--
Siemens AG, Technology
Linux Expert Center


Felix Moessbauer

unread,
Jun 26, 2024, 10:25:37 AM (10 days ago) Jun 26
to isar-...@googlegroups.com, adriaan...@siemens.com, Felix Moessbauer
In case of dpkg-prebuilt, we need to check if the fetched packages are
valid debian packages to only deploy valid ones into the sstate cache.
Otherwise broken packages might end up in the cache and break future
builds.

Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
---
meta/classes/dpkg-prebuilt.bbclass | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/classes/dpkg-prebuilt.bbclass b/meta/classes/dpkg-prebuilt.bbclass
index 7092670b..a6187a07 100644
--- a/meta/classes/dpkg-prebuilt.bbclass
+++ b/meta/classes/dpkg-prebuilt.bbclass
@@ -19,5 +19,8 @@ python do_unpack:prepend() {
# also breaks inherited (from dpkg-base) dependency on sbuild_chroot
do_dpkg_build[depends] = "${PN}:do_unpack"
do_dpkg_build() {
- true
+ # ensure all packages we got are valid debian packages
+ if [ -n "$(find ${WORKDIR} -maxdepth 1 -name '*.deb' -print -quit)" ]; then
+ find ${WORKDIR} -name '*.deb' | xargs -n1 dpkg -I
+ fi
}
--
2.39.2

Uladzimir Bely

unread,
Jun 30, 2024, 11:14:45 PM (5 days ago) Jun 30
to Felix Moessbauer, isar-...@googlegroups.com, adriaan...@siemens.com
On Wed, 2024-06-26 at 16:25 +0200, 'Felix Moessbauer' via isar-users
wrote:
Applied to next, thanks.

--
Best regards,
Uladzimir.
Reply all
Reply to author
Forward
0 new messages