From: Anton Mikanovich <amikan@ilbers.de>
To: isar-users@googlegroups.com
Cc: Anton Mikanovich <amikan@ilbers.de>
Subject: [PATCH 2/6] CI: Add API for sbuild hook insertion
Date: Fri, 21 Feb 2025 17:48:39 +0200 [thread overview]
Message-ID: <20250221154843.515037-3-amikan@ilbers.de> (raw)
In-Reply-To: <20250221154843.515037-1-amikan@ilbers.de>
Custom hook will be added to dpkg.bbclass. Method will return the file
name to be restored after the testing to be sure the sources were not
changed after testsuite running.
This API will be used later for build dependencies checking.
Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
testsuite/cibuilder.py | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/testsuite/cibuilder.py b/testsuite/cibuilder.py
index e671a4ae..d335dbe8 100755
--- a/testsuite/cibuilder.py
+++ b/testsuite/cibuilder.py
@@ -339,6 +339,22 @@ class CIBuilder(Test):
cmd = f"dpkg-query --root={rootfs} -f='${{Version}}' -W {package}"
return process.getoutput(cmd)
+ def set_sbuild_hook(self, hook, type='post-build-commands'):
+ append_data = f" --{type}=\"{hook}\" \\\n"
+
+ layerdir_core = CIUtils.getVars('LAYERDIR_core')
+ sbuildclass_file = os.path.join(layerdir_core, 'classes/dpkg.bbclass')
+ self.backupfile(sbuildclass_file)
+ with open(sbuildclass_file, 'r') as file:
+ lines = file.readlines()
+ with open(sbuildclass_file, 'w') as file:
+ for line in lines:
+ file.write(line)
+ if 'sbuild -A -n' in line:
+ file.write(append_data)
+
+ return sbuildclass_file
+
def get_ssh_cmd_prefix(self, user, host, port, priv_key):
cmd_prefix = (
f"ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no -p {port} "
--
2.34.1
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20250221154843.515037-3-amikan%40ilbers.de.
next prev parent reply other threads:[~2025-02-21 15:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-21 15:48 [PATCH 0/6] Fix essentials rebuild and cover with CI Anton Mikanovich
2025-02-21 15:48 ` [PATCH 1/6] CI: Add API for checking package version in rootfs Anton Mikanovich
2025-02-21 15:48 ` Anton Mikanovich [this message]
2025-02-21 15:48 ` [PATCH 3/6] CI: Add sed as essential rebuild test package Anton Mikanovich
2025-02-21 15:48 ` [PATCH 4/6] CI: Add essential packages rebuild test case Anton Mikanovich
2025-02-21 15:48 ` [PATCH 5/6] CI: Fix getVars API on fast recalling Anton Mikanovich
2025-02-21 15:48 ` [PATCH 6/6] meta: Do not update isar-apt during sbuild chroot prepare Anton Mikanovich
2025-02-21 16:34 ` 'Jan Kiszka' via isar-users
2025-03-03 10:13 ` Anton Mikanovich
2025-03-03 14:32 ` 'Jan Kiszka' via isar-users
2025-03-03 15:16 ` Anton Mikanovich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250221154843.515037-3-amikan@ilbers.de \
--to=amikan@ilbers.de \
--cc=isar-users@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox