public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] isar-apt: Fix copying isar-apt to workdir
@ 2023-04-07  5:32 Uladzimir Bely
  2023-04-12 16:24 ` Uladzimir Bely
  0 siblings, 1 reply; 2+ messages in thread
From: Uladzimir Bely @ 2023-04-07  5:32 UTC (permalink / raw)
  To: isar-users

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-12 16:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-07  5:32 [PATCH] isar-apt: Fix copying isar-apt to workdir Uladzimir Bely
2023-04-12 16:24 ` Uladzimir Bely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox