From f65f73b2c175a9d5616455eb91cfc8f8b1946bd7 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Mon, 17 Aug 2026 17:35:42 +0100 Subject: [PATCH] Makefile: clean residual .deb before dpkg-buildpackage The 'mv' step after dpkg-buildpackage was failing with `mv: '../postit_1.0.6-1_amd64.deb' and '/src/_src/../postit_1.0.6-1_amd64.deb' are the same file` because the amd64 .deb from previous CI runs (or from a partial arm64 build that copied the leftover amd64 .deb) was still in the source directory. Remove any postit_*-1*.deb, *.buildinfo, and *.changes files before invoking dpkg-buildpackage. The fresh build then writes to ../ without colliding with stale output. --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 9bb1b49..4ee6124 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,10 @@ 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 make the final 'mv' complain + # about source and destination being the same file). + rm -f ../postit_*$(POSTIT_GIT_TAG)-1*.deb ../postit_*.buildinfo ../postit_*.changes POSTIT_GIT_URL=$(POSTIT_GIT_URL) POSTIT_GIT_TAG=$(POSTIT_GIT_TAG) POSTIT_RUNTIME=$(POSTIT_RUNTIME) \ dpkg-buildpackage -us -uc -b # Move the produced .deb(s) into $POSTIT_OUT_DIR. The version