public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] dpkg class sbuild allows extra arguments by vars
@ 2023-01-03 19:58 Roberto A. Foglietta
  2023-01-03 20:26 ` Henning Schild
  2023-01-25 12:27 ` Uladzimir Bely
  0 siblings, 2 replies; 9+ messages in thread
From: Roberto A. Foglietta @ 2023-01-03 19:58 UTC (permalink / raw)
  To: isar-users

[-- Attachment #1: Type: text/plain, Size: 467 bytes --]

Hi all,

Sometimes it is necessary to add some extra commands or arguments to sbuild
but create a class into an upper layer just for this breaks the updates.
So, this patch allows setting extra parameters through two variables.

Signed-off-by: Roberto A. Foglietta <roberto.foglietta@gmail.com>
---
 meta/classes/dpkg.bbclass | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

https://github.com/ilbers/isar/commit/7e72921747aedf588af492be95fb0b91ad70f455

[-- Attachment #2: 0001-dpkg-class-sbuild-allows-extra-arguments-by-vars.patch --]
[-- Type: text/x-patch, Size: 2336 bytes --]

From 7e72921747aedf588af492be95fb0b91ad70f455 Mon Sep 17 00:00:00 2001
From: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>
Date: Tue, 3 Jan 2023 20:53:00 +0100
Subject: [PATCH] dpkg class sbuild allows extra arguments by vars

Sometimes it is necessary to add some extra commands or arguments to sbuild
but create a class into an upper layer just for this breaks the updates.
So, this patch allows setting extra parameters through two variables.

Signed-off-by: Roberto A. Foglietta <roberto.foglietta@gmail.com>
---
 meta/classes/dpkg.bbclass | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 7822b14..bf60a5b 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -23,6 +23,9 @@ do_prepare_build_append() {
     env > ${DPKG_PREBUILD_ENV_FILE}
 }
 
+DPKG_SBUILD_EXTRA_ARGS_PRE ?= ""
+DPKG_SBUILD_EXTRA_ARGS_POST ?= ""
+
 # Build package from sources using build script
 dpkg_runbuild[vardepsexclude] += "${SBUILD_PASSTHROUGH_ADDITIONS}"
 dpkg_runbuild() {
@@ -104,7 +107,7 @@ dpkg_runbuild() {
     sbuild -A -n -c ${SBUILD_CHROOT} --extra-repository="${ISAR_APT_REPO}" \
         --host=${PACKAGE_ARCH} --build=${SBUILD_HOST_ARCH} ${profiles} \
         --no-run-lintian --no-run-piuparts --no-run-autopkgtest --resolve-alternatives \
-        --no-apt-update \
+        --no-apt-update ${DPKG_SBUILD_EXTRA_ARGS_PRE} \
         --chroot-setup-commands="echo \"Package: *\nPin: release n=${DEBDISTRONAME}\nPin-Priority: 1000\" > /etc/apt/preferences.d/isar-apt" \
         --chroot-setup-commands="echo \"APT::Get::allow-downgrades 1;\" > /etc/apt/apt.conf.d/50isar-apt" \
         --chroot-setup-commands="rm -f /var/log/dpkg.log" \
@@ -112,7 +115,7 @@ dpkg_runbuild() {
         --finished-build-commands="rm -f ${deb_dir}/sbuild-build-depends-main-dummy_*.deb" \
         --finished-build-commands="cp -n --no-preserve=owner ${deb_dir}/*.deb -t ${ext_deb_dir}/ || :" \
         --finished-build-commands="cp /var/log/dpkg.log ${ext_root}/dpkg_partial.log" \
-        --debbuildopts="--source-option=-I" \
+        --debbuildopts="--source-option=-I" ${DPKG_SBUILD_EXTRA_ARGS_POST} \
         --build-dir=${WORKDIR} --dist="isar" ${DSC_FILE}
 
     sbuild_dpkg_log_export "${WORKDIR}/rootfs/dpkg_partial.log"
-- 
2.34.1


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

end of thread, other threads:[~2023-01-25 16:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-03 19:58 [PATCH] dpkg class sbuild allows extra arguments by vars Roberto A. Foglietta
2023-01-03 20:26 ` Henning Schild
2023-01-03 21:39   ` Roberto A. Foglietta
2023-01-04  7:53     ` Henning Schild
2023-01-05 17:43       ` Roberto A. Foglietta
2023-01-05 18:31         ` Henning Schild
2023-01-05 18:43           ` Roberto A. Foglietta
2023-01-25 12:27 ` Uladzimir Bely
2023-01-25 16:12   ` Roberto A. Foglietta

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