mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-07-07 06:05:59 +08:00
fix: 修复软件包安装状态判断异常问题
check-is-installed 脚本判断软件包是否安装,仅根据执行结果返回;原始逻辑根据返回错误输出进行判断,错误输出为空会造成误判 Log: 修改 QProcess 执行结果判断逻辑,根据 QProcess::exitCode 和 QProcess::exitStatus 判断
This commit is contained in:
parent
363c38cb8f
commit
6c606806a1
@ -133,11 +133,15 @@ void AppIntoPage::openUrl(const QUrl &url)
|
|||||||
bool isInstalled;
|
bool isInstalled;
|
||||||
bool isUpdated;
|
bool isUpdated;
|
||||||
QString packagename = info["Pkgname"].toString();
|
QString packagename = info["Pkgname"].toString();
|
||||||
isInstall.start("/opt/durapps/spark-store/bin/store-helper/check-is-installed", QStringList() << info["Pkgname"].toString());
|
isInstall.start("/opt/durapps/spark-store/bin/store-helper/check-is-installed", QStringList() << info["Pkgname"].toString());
|
||||||
qDebug() << info["Pkgname"].toString();
|
qDebug() << info["Pkgname"].toString();
|
||||||
isInstall.waitForFinished(180 * 1000); // 默认超时 3 分钟
|
isInstall.waitForFinished(180 * 1000); // 默认超时 3 分钟
|
||||||
int error = QString::fromStdString(isInstall.readAllStandardError().toStdString()).length();
|
|
||||||
if (error == 0)
|
int exitCode = isInstall.exitCode();
|
||||||
|
QProcess::ExitStatus exitStatus = isInstall.exitStatus();
|
||||||
|
isInstall.close();
|
||||||
|
|
||||||
|
if (exitCode == 0 && exitStatus == QProcess::NormalExit)
|
||||||
{
|
{
|
||||||
isInstalled = true;
|
isInstalled = true;
|
||||||
|
|
||||||
@ -158,6 +162,7 @@ void AppIntoPage::openUrl(const QUrl &url)
|
|||||||
{
|
{
|
||||||
isUpdated = false;
|
isUpdated = false;
|
||||||
}
|
}
|
||||||
|
isUpdate.close();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user