* [PATCH v2 0/2] Don't update apt database on every package build
@ 2022-10-26 15:32 Uladzimir Bely
2022-10-26 15:32 ` [PATCH v2 1/2] sbuild: " Uladzimir Bely
2022-10-26 15:32 ` [PATCH v2 2/2] sbuild: Set high prio for the packages from isar-apt repo Uladzimir Bely
0 siblings, 2 replies; 3+ messages in thread
From: Uladzimir Bely @ 2022-10-26 15:32 UTC (permalink / raw)
To: isar-users
Here we want to avoid the default behaviour of sbuild when it tries
to update all apt sources.
To have package database consistent, we should rely on one we got
during the debootstrap. The only repo that really needs updates
is local `isar-apt` where custom build depends may be placed.
Also, `isar-apt` should have the high priority over other sources.
Changes since v1:
- Disable only `apt update`, but leave `apt distupgrade` unchanged
(enabled by default). This allows package upgrades from isar-apt repo.
- Added a patch that sets high priority for isar-apt.
Uladzimir Bely (2):
sbuild: Don't update apt database on every package build
sbuild: Set high prio for the packages from isar-apt repo
meta/classes/dpkg.bbclass | 2 ++
1 file changed, 2 insertions(+)
--
2.20.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2 1/2] sbuild: Don't update apt database on every package build
2022-10-26 15:32 [PATCH v2 0/2] Don't update apt database on every package build Uladzimir Bely
@ 2022-10-26 15:32 ` Uladzimir Bely
2022-10-26 15:32 ` [PATCH v2 2/2] sbuild: Set high prio for the packages from isar-apt repo Uladzimir Bely
1 sibling, 0 replies; 3+ messages in thread
From: Uladzimir Bely @ 2022-10-26 15:32 UTC (permalink / raw)
To: isar-users
By default, sbuild updates apt database before the build. It may cause
an inconsistency between apt databases for different packages built at
the different time if external (Debian) mirrors has updated recently.
With new changes, sbuild will rely on global apt state that was got
during debootstrap stage.
Local `isar-apt` repo will still be automatically updated while it is
passed via `--extra-repository` argument.
Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
meta/classes/dpkg.bbclass | 1 +
1 file changed, 1 insertion(+)
diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index c92ea7db..dfa097f8 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -90,6 +90,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 \
--chroot-setup-commands="rm -f /var/log/dpkg.log" \
--chroot-setup-commands="cp -n --no-preserve=owner ${ext_deb_dir}/*.deb -t ${deb_dir}/ || :" \
--finished-build-commands="rm -f ${deb_dir}/sbuild-build-depends-main-dummy_*.deb" \
--
2.20.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2 2/2] sbuild: Set high prio for the packages from isar-apt repo
2022-10-26 15:32 [PATCH v2 0/2] Don't update apt database on every package build Uladzimir Bely
2022-10-26 15:32 ` [PATCH v2 1/2] sbuild: " Uladzimir Bely
@ 2022-10-26 15:32 ` Uladzimir Bely
1 sibling, 0 replies; 3+ messages in thread
From: Uladzimir Bely @ 2022-10-26 15:32 UTC (permalink / raw)
To: isar-users
This sets high priority for `isar-apt` repo during sbuild session.
So, even if some dependency in other repos has higher version than
one we previously built and placed in isar-apt, the second one wil
be selected.
This repeats the behaviour that is implemented in rootfs.bbclass
via `rootfs_configure_isar_apt` that is disabled for sbuild chroot.
We can't simply enable this task for sbuild while we don't want to
have `/etc/apt/sources.list.d/isar-apt.list` file in sbuild chroot
while it's handled via sbuild by `--extra-repository` option
Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
meta/classes/dpkg.bbclass | 1 +
1 file changed, 1 insertion(+)
diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index dfa097f8..c7e7dd34 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -91,6 +91,7 @@ dpkg_runbuild() {
--host=${PACKAGE_ARCH} --build=${SBUILD_HOST_ARCH} ${profiles} \
--no-run-lintian --no-run-piuparts --no-run-autopkgtest --resolve-alternatives \
--no-apt-update \
+ --chroot-setup-commands="echo \"Package: *\nPin: release n=${DEBDISTRONAME}\nPin-Priority: 1000\" > /etc/apt/preferences.d/isar-apt" \
--chroot-setup-commands="rm -f /var/log/dpkg.log" \
--chroot-setup-commands="cp -n --no-preserve=owner ${ext_deb_dir}/*.deb -t ${deb_dir}/ || :" \
--finished-build-commands="rm -f ${deb_dir}/sbuild-build-depends-main-dummy_*.deb" \
--
2.20.1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-10-26 15:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-26 15:32 [PATCH v2 0/2] Don't update apt database on every package build Uladzimir Bely
2022-10-26 15:32 ` [PATCH v2 1/2] sbuild: " Uladzimir Bely
2022-10-26 15:32 ` [PATCH v2 2/2] sbuild: Set high prio for the packages from isar-apt repo Uladzimir Bely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox