public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Uladzimir Bely <ubely@ilbers.de>, isar-users@googlegroups.com
Subject: Re: [PATCH 1/2] Populate base-apt from both DISTRO and HOST_DISTRO download dirs
Date: Thu, 24 Nov 2022 08:31:34 +0100	[thread overview]
Message-ID: <7635a9b3-63e6-7e7a-04a1-3b905cbcf888@siemens.com> (raw)
In-Reply-To: <20221124064213.22283-2-ubely@ilbers.de>

On 24.11.22 07:42, Uladzimir Bely wrote:
> Downstreams may want to change DISTRO to some custom value.
> When cross-building, this leads to downloading packages for host
> and target distros to the different download subdirs.
> 
> While base-apt is populated only from DISTRO download subdir,
> second cached (ISAR_USE_CACHED_BASE_REPO = "1") build fails due to
> missing packages in base-apt.
> 
> Fix it here by populating base-apt from both download subdirs.
> 
> Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> ---
>  meta/recipes-devtools/base-apt/base-apt.bb | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/meta/recipes-devtools/base-apt/base-apt.bb b/meta/recipes-devtools/base-apt/base-apt.bb
> index 506a28ff..e0d47625 100644
> --- a/meta/recipes-devtools/base-apt/base-apt.bb
> +++ b/meta/recipes-devtools/base-apt/base-apt.bb
> @@ -13,7 +13,9 @@ KEYFILES ?= ""
>  BASE_REPO_FEATURES ?= ""
>  
>  populate_base_apt() {
> -    find "${DEBDIR}"/"${DISTRO}" -name '*\.deb' | while read package; do
> +    distro="${1}"
> +
> +    find "${DEBDIR}"/"${distro}" -name '*\.deb' | while read package; do
>          # NOTE: due to packages stored by reprepro are not modified, we can
>          # use search by filename to check if package is already in repo. In
>          # addition, md5sums are compared to ensure that the package is the
> @@ -38,7 +40,7 @@ populate_base_apt() {
>              "${package}"
>      done
>  
> -    find "${DEBSRCDIR}"/"${DISTRO}" -name '*\.dsc' | while read package; do
> +    find "${DEBSRCDIR}"/"${distro}" -name '*\.dsc' | while read package; do
>          repo_add_srcpackage "${REPO_BASE_DIR}"/"${BASE_DISTRO}" \
>              "${REPO_BASE_DB_DIR}"/"${BASE_DISTRO}" \
>              "${BASE_DISTRO_CODENAME}" \
> @@ -66,7 +68,10 @@ repo() {
>                  "Try it without cross-build."
>      fi
>  
> -    populate_base_apt
> +    populate_base_apt "${DISTRO}"
> +    if [ '${DISTRO}' != '${HOST_DISTRO}' ]; then
> +        populate_base_apt "${HOST_DISTRO}"
> +    fi

This assumes BASE_DISTRO(DISTRO) == HOST_DISTRO - well...

Let's do this properly, split base-apt into base-apt-{target,host}, just
like isar-bootstrap. On top, we can then switch from DISTRO/HOST_DISTRO
to their corresponding BASE_DISTROs, though that will be more
complicated as there is no simply algorithm for BASE_DISTRO(HOST_DISTRO)
- unless we assume downstream is not overloading HOST_DISTRO with
anything custom.

Jan

>      repo_sanity_test "${REPO_BASE_DIR}"/"${BASE_DISTRO}" \
>          "${REPO_BASE_DB_DIR}"/"${BASE_DISTRO}"
>  }

-- 
Siemens AG, Technology
Competence Center Embedded Linux


  reply	other threads:[~2022-11-24  7:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-24  6:42 [PATCH 0/2] Fix cross-build from base-apt when custom DISTRO name used Uladzimir Bely
2022-11-24  6:42 ` [PATCH 1/2] Populate base-apt from both DISTRO and HOST_DISTRO download dirs Uladzimir Bely
2022-11-24  7:31   ` Jan Kiszka [this message]
2022-11-24  6:42 ` [PATCH 2/2] testsuite: Run signed repro test in cross mode 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=7635a9b3-63e6-7e7a-04a1-3b905cbcf888@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=ubely@ilbers.de \
    /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