From bdd7205667efc8363aa8de7f2d194c174e77baa1 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Mon, 17 Aug 2026 19:44:44 +0100 Subject: [PATCH] Makefile: scope rm to this build's arch, don't erase sibling builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the workflow runs make deb twice in a row (amd64, then arm64), the second rm -f ../postit_*1.0.6-1*.deb glob matched BOTH postit_1.0.6-1_amd64.deb (produced by the first build) and postit_1.0.6-1_arm64.deb (about to be produced). So the second rm was erasing the first build's output before its own make ran. Result: postit_1.0.6-1_amd64.deb was created and then deleted by the arm64 build, leaving only the .deb arm64 in /src/. The 'Localiser les .deb produits' step failed with amd64=''. Scope the rm to this build's arch tag via DPKG_HOST: rm -f ../postit_-1_${DPKG_HOST}.deb \ ../postit_-1_${DPKG_HOST}.buildinfo \ ../postit_-1_${DPKG_HOST}.changes DPKG_HOST is already computed in the recipe for the dpkg- buildpackage call — we just reuse it for the rm. --- Makefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 18c57d1..43e7fc5 100644 --- a/Makefile +++ b/Makefile @@ -38,10 +38,13 @@ deb: # step the .deb always comes out as the version hardcoded in # debian/changelog.in, regardless of POSTIT_GIT_TAG. sed 's/@VERSION@/$(POSTIT_GIT_TAG)/g' debian/changelog.in > debian/changelog - # Remove any residual .deb from previous runs (same name - # pattern would otherwise be re-used by dpkg-deb if the - # previous run left it lying around). - rm -f ../postit_*$(POSTIT_GIT_TAG)-1*.deb ../postit_*.buildinfo ../postit_*.changes + # Remove only this build's residual .deb (avoid glob-matching + # .debs from sibling builds — the workflow invokes us once per + # architecture, and a wide glob would erase the .deb the + # previous build just produced). The pattern is the same one + # dpkg-deb will reuse if we don't clean up first: postit_- + # 1_.deb. + rm -f ../postit_$(POSTIT_GIT_TAG)-1_$${DPKG_HOST}.deb ../postit_$(POSTIT_GIT_TAG)-1_$${DPKG_HOST}.buildinfo ../postit_$(POSTIT_GIT_TAG)-1_$${DPKG_HOST}.changes # Use dpkg-architecture to set the target arch correctly for # cross-builds. For POSTIT_RUNTIME=linux-arm64, this exports # DEB_HOST_ARCH=arm64 (and friends) so dpkg-buildpackage names