mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-14 04:42:03 +08:00
fix-dpkg
This commit is contained in:
@@ -146,13 +146,13 @@ void AppIntoPage::openUrl(const QUrl &url)
|
|||||||
isInstalled = true;
|
isInstalled = true;
|
||||||
|
|
||||||
QProcess isUpdate;
|
QProcess isUpdate;
|
||||||
isUpdate.start("dpkg-query", QStringList() << "--showformat='${Version}'"
|
isUpdate.start("host-spawn", QStringList() << "dpkg-query" << "--showformat='${Version}'"
|
||||||
<< "--show" << info["Pkgname"].toString());
|
<< "--show" << info["Pkgname"].toString());
|
||||||
isUpdate.waitForFinished(180 * 1000); // 默认超时 3 分钟
|
isUpdate.waitForFinished(180 * 1000); // 默认超时 3 分钟
|
||||||
QString localVersion = isUpdate.readAllStandardOutput();
|
QString localVersion = isUpdate.readAllStandardOutput();
|
||||||
localVersion.replace("'", "");
|
localVersion.replace("'", "");
|
||||||
|
|
||||||
isUpdate.start("dpkg", QStringList() << "--compare-versions" << localVersion << "ge" << info["Version"].toString());
|
isUpdate.start("host-spawn", QStringList() << "dpkg" << "--compare-versions" << localVersion << "ge" << info["Version"].toString());
|
||||||
isUpdate.waitForFinished(180 * 1000); // 默认超时 3 分钟
|
isUpdate.waitForFinished(180 * 1000); // 默认超时 3 分钟
|
||||||
if (!isUpdate.exitCode())
|
if (!isUpdate.exitCode())
|
||||||
{
|
{
|
||||||
@@ -492,7 +492,7 @@ void AppIntoPage::on_pushButton_3_clicked()
|
|||||||
uninstall.waitForFinished(-1);
|
uninstall.waitForFinished(-1);
|
||||||
|
|
||||||
QProcess check;
|
QProcess check;
|
||||||
check.start("dpkg", QStringList() << "-s" << info["Pkgname"].toString().toLower());
|
check.start("host-spawn", QStringList() << "dpkg" << "-s" << info["Pkgname"].toString().toLower());
|
||||||
check.waitForFinished(10*1000);
|
check.waitForFinished(10*1000);
|
||||||
|
|
||||||
if (check.readAllStandardOutput().isEmpty())
|
if (check.readAllStandardOutput().isEmpty())
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ void DownloadItem::slotAsyncInstall(int t)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QProcess isInstall;
|
QProcess isInstall;
|
||||||
isInstall.start("dpkg", QStringList() << "-s" << pkgName);
|
isInstall.start("host-spawn", QStringList() << "dpkg" << "-s" << pkgName);
|
||||||
isInstall.waitForFinished(180 * 1000); // 默认超时 3 分钟
|
isInstall.waitForFinished(180 * 1000); // 默认超时 3 分钟
|
||||||
int error = QString::fromStdString(isInstall.readAllStandardError().toStdString()).length();
|
int error = QString::fromStdString(isInstall.readAllStandardError().toStdString()).length();
|
||||||
if (error == 0 && !haveError)
|
if (error == 0 && !haveError)
|
||||||
|
|||||||
Reference in New Issue
Block a user