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 v3 4/5] Use symlinks when importing debian packages to sbuild chroot
Date: Fri, 20 Jan 2023 08:31:05 +0100	[thread overview]
Message-ID: <20230120073106.5453-5-ubely@ilbers.de> (raw)
In-Reply-To: <20230120073106.5453-1-ubely@ilbers.de>

When building packages, sbuild downloads missing dependencies from
debian mirros. In order to reduce network consuming and have in DL_DIR
every package downloaded by sbuild, we additionally import/export
local debian packages to/from apt cache in schroot upper layer.

Since hardlinks between package WORKDIR and apt cache in schroot
don't work (different filesystems), will use symlinks when importing
debs to schroot (--chroot-setup-commands) and copy with dereference
when exporting them back (--finished-build-commands).

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 meta/classes/dpkg.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 7822b14d..c1a8c77a 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -108,9 +108,9 @@ dpkg_runbuild() {
         --chroot-setup-commands="echo \"Package: *\nPin: release n=${DEBDISTRONAME}\nPin-Priority: 1000\" > /etc/apt/preferences.d/isar-apt" \
         --chroot-setup-commands="echo \"APT::Get::allow-downgrades 1;\" > /etc/apt/apt.conf.d/50isar-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}/ || :" \
+        --chroot-setup-commands="ln -sf ${ext_deb_dir}/*.deb -t ${deb_dir}/ || :" \
         --finished-build-commands="rm -f ${deb_dir}/sbuild-build-depends-main-dummy_*.deb" \
-        --finished-build-commands="cp -n --no-preserve=owner ${deb_dir}/*.deb -t ${ext_deb_dir}/ || :" \
+        --finished-build-commands="cp -Ln --no-preserve=owner ${deb_dir}/*.deb -t ${ext_deb_dir}/ || :" \
         --finished-build-commands="cp /var/log/dpkg.log ${ext_root}/dpkg_partial.log" \
         --debbuildopts="--source-option=-I" \
         --build-dir=${WORKDIR} --dist="isar" ${DSC_FILE}
-- 
2.20.1


  parent reply	other threads:[~2023-01-20  7:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-20  7:31 [PATCH v3 0/5] Improving apt cache Uladzimir Bely
2023-01-20  7:31 ` [PATCH v3 1/5] Clean apt cache from debootstrapped rootfs dirs Uladzimir Bely
2023-01-20  7:31 ` [PATCH v3 2/5] Use hardlinks in deb-dl-dir import/export Uladzimir Bely
2023-01-20  7:31 ` [PATCH v3 3/5] Exclude apt cache from sstate caches Uladzimir Bely
2023-01-20  7:31 ` Uladzimir Bely [this message]
2023-01-20  7:31 ` [PATCH v3 5/5] Lightweight copy of rootfs directories if possible Uladzimir Bely
2023-01-20 13:04 ` [PATCH v3 0/5] Improving apt cache Moessbauer, Felix
2023-01-21  4:12   ` Roberto A. Foglietta
2023-01-24  7:38 ` Uladzimir Bely
2023-01-30  8:45 ` Moessbauer, Felix
2023-01-30  9:56   ` Roberto A. Foglietta
2023-01-30 10:04     ` Roberto A. Foglietta
2023-01-30 10:45   ` Henning Schild
2023-01-30 12:24     ` Roberto A. Foglietta
2023-01-30 14:16   ` Roberto A. Foglietta

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=20230120073106.5453-5-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