mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-10-05 18:12:19 +08:00
fix: 现在安装到ACE的软件包不会再报错了
This commit is contained in:
parent
fb6446292c
commit
05a5b89464
@ -151,24 +151,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
|
||||
{
|
||||
@ -586,11 +587,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();
|
||||
@ -601,7 +602,7 @@ void AppIntoPage::on_pushButton_3_clicked()
|
||||
ui->downloadButton->setEnabled(true);
|
||||
ui->pushButton_3->setEnabled(true);
|
||||
|
||||
check.close();
|
||||
// check.close();
|
||||
});
|
||||
}
|
||||
|
||||
@ -617,4 +618,4 @@ void AppIntoPage::on_updateButton_clicked()
|
||||
{
|
||||
QString feedbackURL = "https://bbs.spark-app.store/";
|
||||
QProcess::startDetached("xdg-open", QStringList{feedbackURL});
|
||||
}
|
||||
}
|
||||
|
@ -216,11 +216,11 @@ 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)
|
||||
// QProcess isInstall;
|
||||
// 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);
|
||||
}
|
||||
|
@ -1,13 +1,14 @@
|
||||
#!/bin/bash
|
||||
dpkg -s "$1" > /dev/null
|
||||
RET="$?"
|
||||
if [[ "$RET" != "0" ]] &&[[ "$IS_ACE_ENV" == "" ]];then ## 如果未在ACE环境中
|
||||
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" > /dev/null
|
||||
RET="$?"
|
||||
if [[ "$RET" != "0" ]] &&[[ "$IS_ACE_ENV" == "" ]];then ## 如果未在ACE环境中
|
||||
|
||||
|
||||
|
||||
for ace_entry in "${ACE_ENVIRONMENTS[@]}"; do
|
||||
|
@ -1,10 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ===== ACE环境配置 =====
|
||||
declare -a ace_commands_order=(
|
||||
readonly ACE_ENVIRONMENTS=(
|
||||
"bookworm-run:amber-ce-bookworm"
|
||||
"trixie-run:amber-ce-trixie"
|
||||
"deepin23-run:amber-ce-deepin23"
|
||||
"sid-run:amber-ce-sid"
|
||||
)
|
||||
|
||||
# ===== 日志和函数 =====
|
||||
@ -72,7 +73,7 @@ function launch_app() {
|
||||
# ===== ACE环境执行器 =====
|
||||
function ace_runner() {
|
||||
local command_type=$1 package_name=$2
|
||||
for ace_entry in "${ace_commands_order[@]}"; do
|
||||
for ace_entry in "${ACE_ENVIRONMENTS[@]}"; do
|
||||
local ace_cmd=${ace_entry%%:*}
|
||||
command -v "$ace_cmd" >/dev/null || continue
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user