mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-05-30 01:31:06 +08:00
fix: 简化包安装检查逻辑并添加二次确认
移除复杂的ACE环境检查逻辑,仅保留基本的dpkg检查 在App.vue中添加二次确认步骤以确保包真实安装
This commit is contained in:
@@ -1,43 +1,6 @@
|
||||
#!/bin/bash
|
||||
readonly ACE_ENVIRONMENTS=(
|
||||
"bookworm-run:amber-ce-bookworm"
|
||||
"trixie-run:amber-ce-trixie"
|
||||
"deepin23-run:amber-ce-deepin23"
|
||||
"sid-run:amber-ce-sid"
|
||||
)
|
||||
dpkg -s "$1" 2>/dev/null | grep -q 'Status: install ok installed' > /dev/null 2>&1
|
||||
RET="$?"
|
||||
if [[ "$RET" != "0" ]] && [[ "$IS_ACE_ENV" == "" ]];then ## 如果未在ACE环境中
|
||||
# 检查包是否已安装
|
||||
# 返回 0 表示已安装,非 0 表示未安装
|
||||
|
||||
for ace_entry in "${ACE_ENVIRONMENTS[@]}"; do
|
||||
ace_cmd=${ace_entry%%:*}
|
||||
if command -v "$ace_cmd" >/dev/null 2>&1; then
|
||||
echo "----------------------------------------"
|
||||
echo "正在检查 $ace_cmd 环境的安装..."
|
||||
echo "----------------------------------------"
|
||||
|
||||
# 在ACE环境中使用dpkg -s检查安装状态
|
||||
# 使用dpkg -s并检查输出中是否包含"Status: install ok installed"
|
||||
$ace_cmd dpkg -s "$1" 2>/dev/null | grep -q 'Status: install ok installed'
|
||||
try_run_ret="$?"
|
||||
|
||||
# 最终检测结果处理
|
||||
if [ "$try_run_ret" -eq 0 ]; then
|
||||
echo "----------------------------------------"
|
||||
echo "在 $ace_cmd 环境中找到了安装"
|
||||
echo "----------------------------------------"
|
||||
exit $try_run_ret
|
||||
else
|
||||
echo "----------------------------------------"
|
||||
echo "在 $ace_cmd 环境中未能找到安装,继续查找"
|
||||
echo "----------------------------------------"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
echo "----------------------------------------"
|
||||
echo "所有已安装的 ACE 环境中未能找到安装,退出"
|
||||
echo "----------------------------------------"
|
||||
exit "$RET"
|
||||
fi
|
||||
## 如果在ACE环境中或者未出错
|
||||
exit "$RET"
|
||||
dpkg -s "$1" 2>/dev/null | grep -q 'Status: install ok installed'
|
||||
exit $?
|
||||
|
||||
+10464
File diff suppressed because it is too large
Load Diff
@@ -835,6 +835,15 @@ const refreshInstalledApps = async () => {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 二次确认:使用 check-installed 验证包是否真正安装
|
||||
const isReallyInstalled = await window.ipcRenderer.invoke(
|
||||
"check-installed",
|
||||
{ pkgname: app.pkgname, origin: app.origin },
|
||||
);
|
||||
if (!isReallyInstalled) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (appInfo) {
|
||||
appInfo.flags = app.flags;
|
||||
appInfo.arch = app.arch;
|
||||
|
||||
Reference in New Issue
Block a user