From a23074725acbcb3ed23ec8538815165038902071 Mon Sep 17 00:00:00 2001 From: CharOfString Date: Sat, 10 Oct 2026 21:12:24 -0500 Subject: [PATCH] exp: Fix arch pkg upload --- tools/arch-repo-update.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/arch-repo-update.sh b/tools/arch-repo-update.sh index 26d6def..80b6ba1 100644 --- a/tools/arch-repo-update.sh +++ b/tools/arch-repo-update.sh @@ -19,7 +19,7 @@ # 用法: # arch-repo-update.sh # 依赖: -# repo-add (Archlinux自带;Debian上需要安装pacman-package-manager) +# repo-add、bsdtar、flock (Archlinux自带;Debian上需要安装pacman-package-manager、libarchive-tools) # 环境变量: # GXDE_ARCH_REPO_ROOT 源根目录,对外地址为 https://repo1.gxde.top/gxde-arch/$arch # GXDE_ARCH_GPG_KEY 可选,设置后对包和数据库进行签名 @@ -29,7 +29,8 @@ # Usage: # arch-repo-update.sh # Dependencies: -# repo-add (Archlinux built-in; on Debian, install pacman-package-manager) +# repo-add, bsdtar, flock (Archlinux built-in; on Debian, install pacman-package-manager +# and libarchive-tools) # Environment variables: # GXDE_ARCH_REPO_ROOT The root directory of the source, externally accessible at # https://repo1.gxde.top/gxde-arch/$arch @@ -57,6 +58,15 @@ echo '██╔═══██║██╔═╝ ██║ ██║ echo '██║ ██║██║ ╚═██████╗██║ ██║████████╗██║██║ ██║╚═██████║██╔═══██╗' echo '╚═╝ ╚═╝╚═╝ ╚═════╝╚═╝ ╚═╝╚═══════╝╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝' +# repo-add依赖bsdtar读取包,缺失时只会报"is not a package file" +# repo-add needs bsdtar to read packages, without it it only says "is not a package file". +for cmd in repo-add bsdtar flock; do + if ! command -v $cmd > /dev/null; then + echo "$cmd not found, install pacman-package-manager and libarchive-tools" >&2 + exit 1 + fi +done + case $arch in x86_64|aarch64) ;; *) echo "Unsupported arch: $arch" >&2; exit 1 ;;