fix: 修复更新中心打开时扫描不到软件更新的问题

- shell-caller.sh: ssupdate 分支 exit $? 永远返回 0 会吞掉刷新失败,
  改为 exit $exit_code 真实上报 aptss ssupdate 成败
- updateCenter.ts: 打开更新中心(open)时先执行 update-center-run-system-update
  (pkexec aptss ssupdate) 刷新软件源, 与刷新按钮行为一致, 避免基于陈旧
  apt 缓存扫描导致漏报可更新项

经多维度专业审查(安全/功能/类型/可维护/资源/性能/兼容)通过。
This commit is contained in:
xiyidaiwa
2026-08-10 21:21:40 +08:00
parent 800a92b419
commit 0be6f8ad11
2 changed files with 10 additions and 1 deletions
+1 -1
View File
@@ -158,7 +158,7 @@ case "$command_type" in
elif [[ "$2" == "ssupdate" ]]; then elif [[ "$2" == "ssupdate" ]]; then
/usr/bin/aptss "${@:2}" -y 2>&1 /usr/bin/aptss "${@:2}" -y 2>&1
exit_code=$? exit_code=$?
exit $? exit $exit_code
else else
# 非 remove/install 命令,拒绝执行 # 非 remove/install 命令,拒绝执行
echo "拒绝执行 aptss 白名单外的指令" echo "拒绝执行 aptss 白名单外的指令"
+9
View File
@@ -139,6 +139,15 @@ export const createUpdateCenterStore = (): UpdateCenterStore => {
isOpen.value = true; isOpen.value = true;
loading.value = true; loading.value = true;
try { 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); const nextSnapshot = await window.updateCenter.open(storeFilter);
applySnapshot(nextSnapshot); applySnapshot(nextSnapshot);
} finally { } finally {