From: "'Felix Moessbauer' via isar-users" <isar-users@googlegroups.com>
To: isar-users@googlegroups.com
Cc: Felix Moessbauer <felix.moessbauer@siemens.com>
Subject: [PATCH 1/1] isar-apt: support further optional fields in Release
Date: Wed, 19 Mar 2025 10:13:47 +0100 [thread overview]
Message-ID: <20250319091347.9181-1-felix.moessbauer@siemens.com> (raw)
The isar-apt repository is a proper apt repository which can be
distributed as-is. A common use-case for that is to build packages which
are then used in a standard Debian by adding the repository to the apt
sources. In this case, it is desired to fill some of the optional fields
in Release to enable fine-grained pinnings.
We extend the repo_create function to allow appending arbitrary fields
to the Release file. To make that easy to use, we introduce the
ISAR_APT_OPT_FIELD bitbake var map. As the do_cache_config task now
depends on user-input, we also ensure it is rebuild when changed.
Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
RECIPE-API-CHANGELOG.md | 5 +++++
meta/classes/repository.bbclass | 10 ++++++++++
meta/recipes-devtools/isar-apt/isar-apt.bb | 6 +++++-
3 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
index 64c0f34a..2801a177 100644
--- a/RECIPE-API-CHANGELOG.md
+++ b/RECIPE-API-CHANGELOG.md
@@ -714,3 +714,8 @@ For example, If `KERNEL_NAME` is configured as `foo` for arm64, now
`linux-libc-dev-foo` and `linux-libc-dev-arm64-cross-foo` package will be
generated. This will help to have multiple versions of linux-libc-dev packages
available for respective bsps in apt feeds.
+
+### ISAR APT Repository
+
+Optional fields of the isar-apt repo can be controlled by adding to the
+`ISAR_APT_OPT_FIELD` map. Example: `ISAR_APT_OPT_FIELD[Origin]="isar"`.
diff --git a/meta/classes/repository.bbclass b/meta/classes/repository.bbclass
index bc5852a5..8fbceed6 100644
--- a/meta/classes/repository.bbclass
+++ b/meta/classes/repository.bbclass
@@ -4,12 +4,19 @@
#
# SPDX-License-Identifier: MIT
+def repo_expand_opt_fields(d, var):
+ f = d.getVarFlags(var)
+ if not f:
+ return ''
+ return '\n'.join('{}: {}'.format(k, v) for k, v in f.items())
+
repo_create() {
local dir="$1"
local dbdir="$2"
local codename="$3"
local distros_in="$4"
local keyfiles="$5"
+ local conf_append="$6"
if [ -n "${GNUPGHOME}" ]; then
export GNUPGHOME="${GNUPGHOME}"
@@ -27,6 +34,9 @@ repo_create() {
done
echo "SignWith: ${option}" >> "${dir}"/conf/distributions
fi
+ if [ -n "${conf_append}" ]; then
+ echo "${conf_append}" >> "${dir}"/conf/distributions
+ fi
fi
if [ ! -d "${dbdir}" ]; then
reprepro -b "${dir}" --dbdir "${dbdir}" export "${codename}"
diff --git a/meta/recipes-devtools/isar-apt/isar-apt.bb b/meta/recipes-devtools/isar-apt/isar-apt.bb
index 187784f9..cda7de89 100644
--- a/meta/recipes-devtools/isar-apt/isar-apt.bb
+++ b/meta/recipes-devtools/isar-apt/isar-apt.bb
@@ -9,6 +9,8 @@ inherit repository
SRC_URI = "file://distributions.in"
do_cache_config[lockfiles] = "${REPO_ISAR_DIR}/isar.lock"
+do_cache_config[vardeps] += "ISAR_APT_OPT_FIELD"
+do_cache_config[cleandirs] += "${REPO_ISAR_DIR}/${DISTRO}/conf"
# Generate reprepro config for current distro if it doesn't exist. Once it's
# generated, this task should do nothing.
@@ -16,7 +18,9 @@ do_cache_config() {
repo_create "${REPO_ISAR_DIR}"/"${DISTRO}" \
"${REPO_ISAR_DB_DIR}"/"${DISTRO}" \
"${DEBDISTRONAME}" \
- "${WORKDIR}/distributions.in"
+ "${WORKDIR}/distributions.in" \
+ "" \
+ "${@ repo_expand_opt_fields(d, 'ISAR_APT_OPT_FIELD')}"
}
addtask cache_config after do_unpack before do_build
--
2.49.0
--
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/20250319091347.9181-1-felix.moessbauer%40siemens.com.
next reply other threads:[~2025-03-19 9:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-19 9:13 'Felix Moessbauer' via isar-users [this message]
2025-03-25 16:58 ` Uladzimir Bely
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=20250319091347.9181-1-felix.moessbauer@siemens.com \
--to=isar-users@googlegroups.com \
--cc=felix.moessbauer@siemens.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