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] isar-apt: Fix copying isar-apt to workdir
Date: Fri,  7 Apr 2023 07:32:17 +0200	[thread overview]
Message-ID: <20230407053217.25921-1-ubely@ilbers.de> (raw)

Using hardlinks (cp -l) for "dists" may lead to a broken isar-apt repo
state when some parallel process changes files in original isar-apt
directory and this is reflected in local isar-apt copy in WORKDIR.

This patch keeps hardlinks only for "pool" and uses copy for "dists".

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

diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index a70f12ff..e3412c82 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -191,9 +191,12 @@ do_prepare_build[depends] = "${SCHROOT_DEP}"
 
 do_prepare_build:append() {
     # Make a local copy of isar-apt repo that is not affected by other parallel builds
-    mkdir -p ${WORKDIR}/isar-apt/${DISTRO}-${DISTRO_ARCH}
-    rm -rf ${WORKDIR}/isar-apt/${DISTRO}-${DISTRO_ARCH}/*
-    cp -Rl ${REPO_ISAR_DIR} ${WORKDIR}/isar-apt/${DISTRO}-${DISTRO_ARCH}
+    rm -rf "${WORKDIR}/isar-apt/${DISTRO}-${DISTRO_ARCH}/*"
+    mkdir -p "${WORKDIR}/isar-apt/${DISTRO}-${DISTRO_ARCH}/apt/${DISTRO}"
+    cp -Rf "${REPO_ISAR_DIR}/${DISTRO}/dists" "${WORKDIR}/isar-apt/${DISTRO}-${DISTRO_ARCH}/apt/${DISTRO}/"
+    if [ -d "${REPO_ISAR_DIR}/${DISTRO}/pool" ]; then
+        cp -Rlf "${REPO_ISAR_DIR}/${DISTRO}/pool" "${WORKDIR}/isar-apt/${DISTRO}-${DISTRO_ARCH}/apt/${DISTRO}/"
+    fi
 }
 
 do_prepare_build[lockfiles] += "${REPO_ISAR_DIR}/isar.lock"
-- 
2.20.1


             reply	other threads:[~2023-04-07  5:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-07  5:32 Uladzimir Bely [this message]
2023-04-12 16:24 ` 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=20230407053217.25921-1-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