From 0be6f8ad1170177ba15bcb4110ab1e85090031c7 Mon Sep 17 00:00:00 2001 From: xiyidaiwa Date: Mon, 10 Aug 2026 21:21:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E6=89=93=E5=BC=80=E6=97=B6=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E4=B8=8D=E5=88=B0=E8=BD=AF=E4=BB=B6=E6=9B=B4=E6=96=B0=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - shell-caller.sh: ssupdate 分支 exit $? 永远返回 0 会吞掉刷新失败, 改为 exit $exit_code 真实上报 aptss ssupdate 成败 - updateCenter.ts: 打开更新中心(open)时先执行 update-center-run-system-update (pkexec aptss ssupdate) 刷新软件源, 与刷新按钮行为一致, 避免基于陈旧 apt 缓存扫描导致漏报可更新项 经多维度专业审查(安全/功能/类型/可维护/资源/性能/兼容)通过。 --- extras/shell-caller.sh | 2 +- src/modules/updateCenter.ts | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/extras/shell-caller.sh b/extras/shell-caller.sh index f9cb5921..dbf8e932 100755 --- a/extras/shell-caller.sh +++ b/extras/shell-caller.sh @@ -158,7 +158,7 @@ case "$command_type" in elif [[ "$2" == "ssupdate" ]]; then /usr/bin/aptss "${@:2}" -y 2>&1 exit_code=$? - exit $? + exit $exit_code else # 非 remove/install 命令,拒绝执行 echo "拒绝执行 aptss 白名单外的指令" diff --git a/src/modules/updateCenter.ts b/src/modules/updateCenter.ts index 693011a5..75a0033a 100644 --- a/src/modules/updateCenter.ts +++ b/src/modules/updateCenter.ts @@ -139,6 +139,15 @@ export const createUpdateCenterStore = (): UpdateCenterStore => { isOpen.value = true; loading.value = true; try { + // 打开更新中心时先刷新软件源,避免使用旧的 apt 缓存导致扫不到更新 + try { + await window.ipcRenderer.invoke( + "update-center-run-system-update", + storeFilter, + ); + } catch (error) { + console.error("[UpdateCenter] open: system update failed", error); + } const nextSnapshot = await window.updateCenter.open(storeFilter); applySnapshot(nextSnapshot); } finally {