From a32c0cd78f94c17c16d9cac291e244565b3c3845 Mon Sep 17 00:00:00 2001 From: cflmy Date: Thu, 15 Oct 2026 13:42:37 +0800 Subject: [PATCH] fix(ppa): skip cp when local orig already sits in build-area Co-authored-by: Cursor --- scripts/ppa-build-source.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/ppa-build-source.sh b/scripts/ppa-build-source.sh index 53a58a3..3dceb35 100755 --- a/scripts/ppa-build-source.sh +++ b/scripts/ppa-build-source.sh @@ -124,7 +124,10 @@ if [ "$REUSE_ORIG" -eq 1 ]; then echo "==> reusing published ${ORIG_NAME} (debian-only bump; do not rewrite orig)" echo " source: ${ORIG_SRC}" sha256sum "$ORIG_SRC" - cp -f "$ORIG_SRC" "$BUILD_AREA/$ORIG_NAME" + # Local fallback may already be build-area/ORIG_NAME — do not cp onto itself. + if [ "$(realpath "$ORIG_SRC")" != "$(realpath "$BUILD_AREA/$ORIG_NAME" 2>/dev/null || echo "")" ]; then + cp -f "$ORIG_SRC" "$BUILD_AREA/$ORIG_NAME" + fi # Unpack orig (top dir is usually ${VER} or marqdo-${VER}) tar -xJf "$BUILD_AREA/$ORIG_NAME" -C "$(dirname "$PKG_ROOT")" if [ ! -d "$PKG_ROOT" ]; then