mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-14 21:02:04 +08:00
syncx: 现在安装到ACE的软件包不会再报错了
This commit is contained in:
@@ -150,24 +150,25 @@ void AppIntoPage::openUrl(const QUrl &url)
|
||||
{
|
||||
isInstalled = true;
|
||||
|
||||
QProcess isUpdate;
|
||||
isUpdate.start("dpkg-query", QStringList() << "--showformat='${Version}'"
|
||||
<< "--show" << info["Pkgname"].toString());
|
||||
isUpdate.waitForFinished(180 * 1000); // 默认超时 3 分钟
|
||||
QString localVersion = isUpdate.readAllStandardOutput();
|
||||
localVersion.replace("'", "");
|
||||
// QProcess isUpdate;
|
||||
// isUpdate.start("dpkg-query", QStringList() << "--showformat='${Version}'"
|
||||
// << "--show" << info["Pkgname"].toString());
|
||||
// isUpdate.waitForFinished(180 * 1000); // 默认超时 3 分钟
|
||||
// QString localVersion = isUpdate.readAllStandardOutput();
|
||||
// localVersion.replace("'", "");
|
||||
|
||||
isUpdate.start("dpkg", QStringList() << "--compare-versions" << localVersion << "ge" << info["Version"].toString());
|
||||
isUpdate.waitForFinished(180 * 1000); // 默认超时 3 分钟
|
||||
if (isUpdate.exitCode() == 0 && isUpdate.exitStatus() == QProcess::NormalExit)
|
||||
{
|
||||
isUpdated = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
isUpdated = false;
|
||||
}
|
||||
isUpdate.close();
|
||||
// isUpdate.start("dpkg", QStringList() << "--compare-versions" << localVersion << "ge" << info["Version"].toString());
|
||||
// isUpdate.waitForFinished(180 * 1000); // 默认超时 3 分钟
|
||||
// if (isUpdate.exitCode() == 0 && isUpdate.exitStatus() == QProcess::NormalExit)
|
||||
// {
|
||||
// isUpdated = true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// isUpdated = false;
|
||||
// }
|
||||
// isUpdate.close();
|
||||
isUpdated = true; //去掉直接点击升级的功能
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -585,11 +586,11 @@ void AppIntoPage::on_pushButton_3_clicked()
|
||||
uninstall.waitForFinished(-1);
|
||||
uninstall.close();
|
||||
|
||||
QProcess check;
|
||||
check.start("dpkg", QStringList() << "-s" << info["Pkgname"].toString().toLower());
|
||||
check.waitForFinished(-1);
|
||||
// QProcess check;
|
||||
// check.start("dpkg", QStringList() << "-s" << info["Pkgname"].toString().toLower());
|
||||
// check.waitForFinished(-1);
|
||||
|
||||
if (check.exitCode() != 0 || check.exitStatus() != QProcess::NormalExit)
|
||||
if (uninstall.exitCode() != 0 || uninstall.exitStatus() != QProcess::NormalExit)
|
||||
{
|
||||
ui->downloadButton->setText(tr("Download and Install"));
|
||||
ui->pushButton_3->hide();
|
||||
@@ -600,7 +601,7 @@ void AppIntoPage::on_pushButton_3_clicked()
|
||||
ui->downloadButton->setEnabled(true);
|
||||
ui->pushButton_3->setEnabled(true);
|
||||
|
||||
check.close();
|
||||
// check.close();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -217,10 +217,10 @@ void DownloadItem::slotAsyncInstall(int t)
|
||||
}
|
||||
|
||||
QProcess isInstall;
|
||||
isInstall.start("dpkg", QStringList() << "-s" << pkgName);
|
||||
isInstall.waitForFinished(180 * 1000); // 默认超时 3 分钟
|
||||
int error = QString::fromStdString(isInstall.readAllStandardError().toStdString()).length();
|
||||
if (error == 0 && !haveError)
|
||||
// isInstall.start("dpkg", QStringList() << "-s" << pkgName);
|
||||
// isInstall.waitForFinished(180 * 1000); // 默认超时 3 分钟
|
||||
// int error = QString::fromStdString(isInstall.readAllStandardError().toStdString()).length();
|
||||
if ( !haveError)
|
||||
{
|
||||
ui->pushButton_install->hide();
|
||||
Utils::sendNotification("spark-store", tr("Spark Store"), ui->label->text() + " " + tr("Installation complete."));
|
||||
@@ -252,5 +252,5 @@ void DownloadItem::slotAsyncInstall(int t)
|
||||
ui->widget_spinner->hide();
|
||||
DownloadItem::isInstall = false;
|
||||
|
||||
emit finished(error == 0 && !haveError && !notRoot);
|
||||
emit finished(!haveError && !notRoot);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user