* [PATCH v2] dpkg-base: Fix and improve handling of multiple apt sources per package
@ 2024-01-27 7:56 Uladzimir Bely
2024-01-29 10:49 ` Uladzimir Bely
0 siblings, 1 reply; 2+ messages in thread
From: Uladzimir Bely @ 2024-01-27 7:56 UTC (permalink / raw)
To: isar-users
From: Jan Kiszka <jan.kiszka@siemens.com>
Due to overeager quoting, multiple entries in SRC_APT would have led to
build errors, rather than mulitple invocations of the fetching and
unpacking steps.
While fixing that, also avoid pointless re-entries into the schroot by
simply pulling the loop into it.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Uladzimir Bely <ubely@ilbers.de>
---
This goes on top of https://groups.google.com/g/isar-users/c/k8ZNw3OkWLw/m/1s_CPTlPAAAJ
[PATCH v7] dpkg: Restore support for replacing pre-installed packages in sbuild-chroot.
Tested in CI.
We need v2 since previous version conflicts with new changes of "parent" patch v7.
meta/classes/dpkg-base.bbclass | 31 ++++++++++++++++++-------------
1 file changed, 18 insertions(+), 13 deletions(-)
diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index 86466b57..a8263046 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -119,10 +119,15 @@ do_apt_fetch() {
schroot -r -c ${session_id} -d / -u root -- \
rm /etc/apt/sources.list.d/isar-apt.list /etc/apt/preferences.d/isar-apt
- for uri in "${SRC_APT}"; do
- schroot -r -c ${session_id} -d / -- \
- sh -c 'mkdir -p /downloads/deb-src/"$1"/"$2" && cd /downloads/deb-src/"$1"/"$2" && apt-get -y --download-only --only-source source "$2"' my_script "${BASE_DISTRO}-${BASE_DISTRO_CODENAME}" "${uri}"
- done
+ schroot -r -c ${session_id} -d / -- \
+ sh -c '
+ set -e
+ for uri in $2; do
+ mkdir -p /downloads/deb-src/"$1"/${uri}
+ cd /downloads/deb-src/"$1"/${uri}
+ apt-get -y --download-only --only-source source ${uri}
+ done' \
+ my_script "${BASE_DISTRO}-${BASE_DISTRO_CODENAME}" "${SRC_APT}"
schroot -e -c ${session_id}
schroot_delete_configs
@@ -145,16 +150,16 @@ do_apt_unpack() {
trap 'exit 1' INT HUP QUIT TERM ALRM USR1
trap 'schroot_cleanup' EXIT
- for uri in "${SRC_APT}"; do
- schroot -d / -c ${SBUILD_CHROOT} -- \
- sh -c ' \
- set -e
- dscfile="$(apt-get -y -qq --print-uris --only-source source "${2}" | cut -d " " -f2 | grep -E "*.dsc")"
+ schroot -d / -c ${SBUILD_CHROOT} -- \
+ sh -c '
+ set -e
+ for uri in $2; do
+ dscfile="$(apt-get -y -qq --print-uris --only-source source $uri | cut -d " " -f2 | grep -E "*.dsc")"
cd ${PP}
- cp /downloads/deb-src/"${1}"/"${2}"/* ${PP}
- dpkg-source -x "${dscfile}" "${PPS}"' \
- my_script "${BASE_DISTRO}-${BASE_DISTRO_CODENAME}" "${uri}"
- done
+ cp /downloads/deb-src/"${1}"/${uri}/* ${PP}
+ dpkg-source -x "${dscfile}" "${PPS}"
+ done' \
+ my_script "${BASE_DISTRO}-${BASE_DISTRO_CODENAME}" "${SRC_APT}"
schroot_delete_configs
}
do_apt_unpack[network] = "${TASK_USE_SUDO}"
--
2.20.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v2] dpkg-base: Fix and improve handling of multiple apt sources per package
2024-01-27 7:56 [PATCH v2] dpkg-base: Fix and improve handling of multiple apt sources per package Uladzimir Bely
@ 2024-01-29 10:49 ` Uladzimir Bely
0 siblings, 0 replies; 2+ messages in thread
From: Uladzimir Bely @ 2024-01-29 10:49 UTC (permalink / raw)
To: isar-users
On Sat, 2024-01-27 at 08:56 +0100, Uladzimir Bely wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> Due to overeager quoting, multiple entries in SRC_APT would have led
> to
> build errors, rather than mulitple invocations of the fetching and
> unpacking steps.
>
> While fixing that, also avoid pointless re-entries into the schroot
> by
> simply pulling the loop into it.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> Reviewed-by: Uladzimir Bely <ubely@ilbers.de>
> ---
>
Applied to next, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-01-29 10:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-27 7:56 [PATCH v2] dpkg-base: Fix and improve handling of multiple apt sources per package Uladzimir Bely
2024-01-29 10:49 ` Uladzimir Bely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox