From ffb200fd43087b31d8ad4b161ec4612515d93a28 Mon Sep 17 00:00:00 2001 From: imbytecat Date: Fri, 3 Apr 2026 14:36:49 +0800 Subject: [PATCH] =?UTF-8?q?refactor(install):=20=E7=A7=BB=E9=99=A4=20yay?= =?UTF-8?q?=20=E4=BE=9D=E8=B5=96=EF=BC=8Cdecman=20=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=20makepkg=20=E5=AE=89=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AGENTS.md | 4 ++-- modules/base.py | 1 - scripts/install.sh | 28 +++++++++++----------------- 3 files changed, 13 insertions(+), 20 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 54de978..495f3af 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -6,7 +6,7 @@ - **运行环境**:Arch Linux(主要面向 WSL,兼容裸机) - **语言**:Python(配置)、Bash(引导脚本) -- **包管理器**:uv(开发依赖)、pacman/yay(系统包) +- **包管理器**:uv(开发依赖)、pacman(系统包)、decman AUR 插件(AUR 包) ## 仓库结构 @@ -23,7 +23,7 @@ ├── system/etc/ # 系统配置文件源 → 部署到 /etc/ ├── home/ # 用户配置文件源 → 部署到 ~/ ├── scripts/ -│ ├── install.sh # 引导脚本(git → yay → decman → 首次 sync) +│ ├── install.sh # 引导脚本(git → decman → 首次 sync) │ └── wsl-init.sh # WSL 首次初始化(创建用户) └── pyproject.toml # 开发依赖(decman + 插件,仅用于类型检查) ``` diff --git a/modules/base.py b/modules/base.py index 59a296f..467822b 100644 --- a/modules/base.py +++ b/modules/base.py @@ -65,5 +65,4 @@ class BaseModule(Module): def aur_packages(self) -> set[str]: return { "decman", - "yay-bin", } diff --git a/scripts/install.sh b/scripts/install.sh index bbe4ea8..1fed2a6 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -7,8 +7,11 @@ CONFIG_DIR="$HOME/.config/archlinux-config" echo "==> 验证 sudo 权限..." sudo -v < /dev/tty || { echo "错误:需要 sudo 权限,请确认当前用户已配置 sudo"; exit 1; } -echo "==> 安装 git..." -sudo pacman -S --needed --noconfirm git +echo "==> 更新系统..." +sudo pacman -Syu --noconfirm + +echo "==> 安装基础依赖..." +sudo pacman -S --needed --noconfirm git base-devel echo "==> 克隆配置仓库..." mkdir -p "$(dirname "$CONFIG_DIR")" @@ -21,22 +24,13 @@ else git clone "$REPO_URL" "$CONFIG_DIR" fi -echo "==> 更新系统..." -sudo pacman -Syu --noconfirm - -echo "==> 安装 base-devel..." -sudo pacman -S --needed --noconfirm base-devel - -echo "==> 安装 yay-bin..." -if ! command -v yay &> /dev/null; then - rm -rf /tmp/yay-bin - git clone https://aur.archlinux.org/yay-bin.git /tmp/yay-bin - (cd /tmp/yay-bin && makepkg -si --noconfirm) - rm -rf /tmp/yay-bin -fi - echo "==> 安装 decman..." -yay -S --needed --noconfirm decman +if ! command -v decman &> /dev/null; then + rm -rf /tmp/decman + git clone https://aur.archlinux.org/decman.git /tmp/decman + (cd /tmp/decman && makepkg -si --noconfirm) + rm -rf /tmp/decman +fi echo "==> 应用系统配置..." sudo decman --source "$CONFIG_DIR/source.py" < /dev/tty