[02/13] dpkg-raw: do not leak package variants into debian package

Message ID 20261002144936.246628-3-felix.moessbauer@siemens.com
State New
Headers show
Series More build time reductions | expand

Commit Message

Felix Moessbauer Oct. 2, 2026, 2:49 p.m. UTC
When generating a dpkg-raw package from a -native or -compat variant,
the wrong install file is looked up (${PN}.install vs. ${BPN}.install)
and the root dir name of the generated source package is wrong
(${PN}-${PV} vs. ${BPN}-${PV}). By that, sbuild does not consider the
files in the debian dir and silently generates an empty package.

As dpkg-raw packages usually only were generated in its natural form
(PN = BPN), this bug remained unnoticed for a long time.

Fixes: c63bb31b ("add multiarch support")
Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 meta/classes-recipe/dpkg-raw.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/classes-recipe/dpkg-raw.bbclass b/meta/classes-recipe/dpkg-raw.bbclass
index 7860389e..97207fff 100644
--- a/meta/classes-recipe/dpkg-raw.bbclass
+++ b/meta/classes-recipe/dpkg-raw.bbclass
@@ -9,6 +9,7 @@  inherit dpkg
 # adding excluded files, e.g. *.so to a package.
 DPKG_SOURCE_EXTRA_ARGS = ""
 
+S = "${WORKDIR}/${BPN}-${PV}"
 D = "${S}/image"
 
 # Default to creating a binary-indep package
@@ -27,7 +28,7 @@  do_prepare_build[cleandirs] += "${S}/debian"
 do_prepare_build() {
 	cd ${D}
 	find . -maxdepth 1 ! -name .. -and ! -name . -and ! -name debian | \
-		sed 's:^./::' | sort > ${S}/debian/${PN}.install
+		sed 's:^./::' | sort > ${S}/debian/${BPN}.install
 
 	deb_debianize