From 033063992864bbaf8476c2baf808040ce8394997 Mon Sep 17 00:00:00 2001 From: cysamurai Date: Thu, 14 May 2026 15:31:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8C=85=E8=84=9A=E6=9C=AC=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/build-apt-repo.sh | 2 ++ scripts/verify-apt-repo.sh | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/scripts/build-apt-repo.sh b/scripts/build-apt-repo.sh index 0bba958..8bd5b9e 100644 --- a/scripts/build-apt-repo.sh +++ b/scripts/build-apt-repo.sh @@ -173,6 +173,8 @@ for arch in $ARCHES; do done apt-ftparchive packages "$tmp_pool" > "$out_dir/Packages" + # apt-ftparchive 会把临时目录的绝对路径写入 Filename,客户端无法下载;改为相对仓库根的 pool/... 路径。 + sed -i "s|^Filename: .*\\.tmp-pool-${arch}/|Filename: pool/${COMPONENT}/|" "$out_dir/Packages" gzip -kf "$out_dir/Packages" rm -rf "$tmp_pool" done diff --git a/scripts/verify-apt-repo.sh b/scripts/verify-apt-repo.sh index ad1feb2..b2414d7 100644 --- a/scripts/verify-apt-repo.sh +++ b/scripts/verify-apt-repo.sh @@ -88,6 +88,10 @@ for arch in $ARCHES; do echo "错误: Packages.gz 不是有效 gzip 文件: $pkg_gz" >&2 exit 1 fi + if gzip -dc "$pkg_gz" | grep -q '^Filename:.*\.tmp-pool-'; then + echo "错误: $pkg_gz 中 Filename 仍指向构建临时目录 .tmp-pool-*,客户端无法下载。请使用最新 scripts/build-apt-repo.sh 重新生成 dist/repo。" >&2 + exit 1 + fi done if ! find "$REPO_DIR/pool/$COMPONENT" -type f -name "*.deb" | read -r _; then