public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Uladzimir Bely <ubely@ilbers.de>
To: isar-users@googlegroups.com
Subject: [PATCH 1/2] Populate base-apt from both DISTRO and HOST_DISTRO download dirs
Date: Thu, 24 Nov 2022 07:42:12 +0100	[thread overview]
Message-ID: <20221124064213.22283-2-ubely@ilbers.de> (raw)
In-Reply-To: <20221124064213.22283-1-ubely@ilbers.de>

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
     repo_sanity_test "${REPO_BASE_DIR}"/"${BASE_DISTRO}" \
         "${REPO_BASE_DB_DIR}"/"${BASE_DISTRO}"
 }
-- 
2.20.1


  reply	other threads:[~2022-11-24  6:42 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 ` Uladzimir Bely [this message]
2022-11-24  7:31   ` [PATCH 1/2] Populate base-apt from both DISTRO and HOST_DISTRO download dirs Jan Kiszka
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=20221124064213.22283-2-ubely@ilbers.de \
    --to=ubely@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