mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-09-04 02:12:21 +08:00
3.2.1 更新源服务器改为aptss
This commit is contained in:
parent
d3987a20ec
commit
a252e7b724
7
debian/changelog
vendored
7
debian/changelog
vendored
@ -1,3 +1,10 @@
|
||||
spark-store (3.2.1) stable; urgency=medium
|
||||
|
||||
* 更改刷新系统源的功能
|
||||
|
||||
|
||||
-- shenmo <shenmo@spark-app.store> Fri, 30 Jan 2022 00:00:00 +0800
|
||||
|
||||
spark-store (3.2) stable; urgency=medium
|
||||
|
||||
* 新增 下载量统计功能
|
||||
|
@ -30,7 +30,7 @@ int main(int argc, char *argv[])
|
||||
DAboutDialog dialog;
|
||||
a.setAboutDialog(&dialog);
|
||||
dialog.setLicense(QObject::tr("We publish this program under GPL V3"));
|
||||
dialog.setVersion(DApplication::buildVersion("Version 3.2"));
|
||||
dialog.setVersion(DApplication::buildVersion("Version 3.2.1"));
|
||||
dialog.setProductIcon(QIcon::fromTheme("spark-store")); // 设置Logo
|
||||
dialog.setProductName(QLabel::tr("Spark Store"));
|
||||
dialog.setDescription(
|
||||
@ -51,7 +51,7 @@ int main(int argc, char *argv[])
|
||||
a.setOrganizationName("spark-union");
|
||||
a.setOrganizationDomain("https://www.deepinos.org/");
|
||||
a.setApplicationName("Spark Store"); //不需要翻译,否则 ~/.local/share/ 下文件夹名称也被翻译为中文
|
||||
a.setApplicationVersion(DApplication::buildVersion("3.2"));
|
||||
a.setApplicationVersion(DApplication::buildVersion("3.2.1"));
|
||||
a.setApplicationAcknowledgementPage("https://gitee.com/deepin-community-store/spark-store");
|
||||
a.setApplicationDescription(
|
||||
QObject::tr(
|
||||
|
@ -1090,46 +1090,8 @@ void Widget::on_pushButton_updateApt_clicked()
|
||||
ui->pushButton_updateApt->setEnabled(false);
|
||||
ui->label_aptserver->setText(tr("Updating, please wait..."));
|
||||
|
||||
std::fstream sourcesList, policy, update;
|
||||
QDir tmpdir("/tmp");
|
||||
auto tmpPath = QString::fromUtf8(TMP_PATH).toStdString();
|
||||
bool unknownError = true;
|
||||
|
||||
tmpdir.mkpath("spark-store");
|
||||
sourcesList.open(tmpPath + "/sparkstore.list", std::ios::out);
|
||||
// 商店已经下架会替换系统库的包,优先级 policy 弃用
|
||||
// policy.open(tmpPath + "/sparkstore", std::ios::out);
|
||||
|
||||
if(sourcesList /*&& policy*/)
|
||||
{
|
||||
auto serverAddr = ui->comboBox_server->currentText();
|
||||
|
||||
sourcesList << "deb [by-hash=force] ";
|
||||
sourcesList << serverAddr.toUtf8().toStdString();
|
||||
sourcesList << " /";
|
||||
sourcesList.close();
|
||||
|
||||
/*
|
||||
* policy << "Package: *\n" << "Pin: origin *" <<
|
||||
* serverAddr.mid(serverAddr.indexOf('.')).toUtf8().toStdString() << "\n" <<
|
||||
* "Pin-Priority: 90"; // 降低星火源的优先级,防止从星火安装已存在的系统包,破坏依赖
|
||||
* policy.close();
|
||||
*/
|
||||
|
||||
update.open(tmpPath + "/update.sh", std::ios::out);
|
||||
if(update)
|
||||
{
|
||||
unknownError = false;
|
||||
update << "#!/bin/sh\n" <<
|
||||
"mv " + tmpPath + "/sparkstore.list /etc/apt/sources.list.d/sparkstore.list && " <<
|
||||
// "mv " + tmpPath + "/sparkstore /etc/apt/preferences.d/sparkstore && " <<
|
||||
"apt update";
|
||||
update.close();
|
||||
|
||||
system(("chmod +x " + tmpPath + "/update.sh").c_str());
|
||||
|
||||
QProcess runupdate;
|
||||
runupdate.start("pkexec", QStringList() << QString::fromStdString(tmpPath + "/update.sh"));
|
||||
runupdate.start("pkexec" , QStringList() << "aptss" << "ssupdate");
|
||||
runupdate.waitForFinished();
|
||||
QString error = runupdate.readAllStandardError();
|
||||
|
||||
@ -1145,22 +1107,21 @@ void Widget::on_pushButton_updateApt_clicked()
|
||||
|
||||
if(!haveError)
|
||||
{
|
||||
ui->label_aptserver->setText("deb [by-hash=force] " + ui->comboBox_server->currentText().toUtf8() + " /");
|
||||
ui->label_aptserver->setText(tr("Update finished"));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->label_aptserver->setText(tr("Apt has reported an error. Please use apt update in terminal to locate the problem."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(unknownError)
|
||||
{
|
||||
ui->label_aptserver->setText(tr("Unknown error!"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ui->pushButton_updateApt->setEnabled(true);
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
void Widget::on_pushButton_uninstall_clicked()
|
||||
|
@ -150,7 +150,7 @@
|
||||
<message>
|
||||
<location filename="../src/widget.ui" line="547"/>
|
||||
<location filename="../src/widget.cpp" line="910"/>
|
||||
<location filename="../src/widget.cpp" line="1183"/>
|
||||
<location filename="../src/widget.cpp" line="1144"/>
|
||||
<source>Install</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -493,17 +493,12 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widget.cpp" line="1152"/>
|
||||
<location filename="../src/widget.cpp" line="1114"/>
|
||||
<source>Apt has reported an error. Please use apt update in terminal to locate the problem.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widget.cpp" line="1159"/>
|
||||
<source>Unknown error!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widget.cpp" line="1187"/>
|
||||
<location filename="../src/widget.cpp" line="1148"/>
|
||||
<source>Uninstall succeeded</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -518,12 +513,17 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widget.cpp" line="1209"/>
|
||||
<location filename="../src/widget.cpp" line="1110"/>
|
||||
<source>Update finished</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widget.cpp" line="1170"/>
|
||||
<source>Temporary cache was cleaned</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widget.cpp" line="1291"/>
|
||||
<location filename="../src/widget.cpp" line="1252"/>
|
||||
<source>The URL has been copied to the clipboard</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -211,7 +211,7 @@ Nous sommes nés pour le changement.</translation>
|
||||
<message>
|
||||
<location filename="../src/widget.ui" line="547"/>
|
||||
<location filename="../src/widget.cpp" line="910"/>
|
||||
<location filename="../src/widget.cpp" line="1183"/>
|
||||
<location filename="../src/widget.cpp" line="1144"/>
|
||||
<source>Install</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -650,6 +650,11 @@ Nous sommes nés pour le changement.</translation>
|
||||
<source>Reinstall</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widget.cpp" line="1110"/>
|
||||
<source>Update finished</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widget.cpp" line="625"/>
|
||||
<source>Failed to get the name to the file to be downloaded.</source>
|
||||
@ -676,27 +681,22 @@ Nous sommes nés pour le changement.</translation>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widget.cpp" line="1152"/>
|
||||
<location filename="../src/widget.cpp" line="1114"/>
|
||||
<source>Apt has reported an error. Please use apt update in terminal to locate the problem.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widget.cpp" line="1159"/>
|
||||
<source>Unknown error!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widget.cpp" line="1187"/>
|
||||
<location filename="../src/widget.cpp" line="1148"/>
|
||||
<source>Uninstall succeeded</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widget.cpp" line="1209"/>
|
||||
<location filename="../src/widget.cpp" line="1170"/>
|
||||
<source>Temporary cache was cleaned</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widget.cpp" line="1291"/>
|
||||
<location filename="../src/widget.cpp" line="1252"/>
|
||||
<source>The URL has been copied to the clipboard</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -205,7 +205,7 @@
|
||||
<message>
|
||||
<location filename="../src/widget.ui" line="547"/>
|
||||
<location filename="../src/widget.cpp" line="910"/>
|
||||
<location filename="../src/widget.cpp" line="1183"/>
|
||||
<location filename="../src/widget.cpp" line="1144"/>
|
||||
<source>Install</source>
|
||||
<translation>安装</translation>
|
||||
</message>
|
||||
@ -476,7 +476,7 @@
|
||||
<message>
|
||||
<location filename="../src/widget.ui" line="912"/>
|
||||
<source>Request Update</source>
|
||||
<translation type="unfinished">软件催更/应用反馈</translation>
|
||||
<translation>软件催更/应用反馈</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widget.ui" line="1194"/>
|
||||
@ -518,6 +518,11 @@
|
||||
<source>Not Exist</source>
|
||||
<translation>不存在</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widget.cpp" line="1110"/>
|
||||
<source>Update finished</source>
|
||||
<translation type="unfinished">更新完毕</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widget.cpp" line="139"/>
|
||||
<location filename="../src/widget.cpp" line="409"/>
|
||||
@ -599,14 +604,13 @@
|
||||
<translation>正在更新,请稍候……</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widget.cpp" line="1152"/>
|
||||
<location filename="../src/widget.cpp" line="1114"/>
|
||||
<source>Apt has reported an error. Please use apt update in terminal to locate the problem.</source>
|
||||
<translation>更新中发生错误,请在终端使用apt update来查看错误原因。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widget.cpp" line="1159"/>
|
||||
<source>Unknown error!</source>
|
||||
<translation>未知错误!</translation>
|
||||
<translation type="vanished">未知错误!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Yes</source>
|
||||
@ -656,17 +660,17 @@ Click yes to continue.</source>
|
||||
<translation type="vanished">服务器未知错误</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widget.cpp" line="1187"/>
|
||||
<location filename="../src/widget.cpp" line="1148"/>
|
||||
<source>Uninstall succeeded</source>
|
||||
<translation>卸载成功</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widget.cpp" line="1209"/>
|
||||
<location filename="../src/widget.cpp" line="1170"/>
|
||||
<source>Temporary cache was cleaned</source>
|
||||
<translation>缓存目录已清空</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widget.cpp" line="1291"/>
|
||||
<location filename="../src/widget.cpp" line="1252"/>
|
||||
<source>The URL has been copied to the clipboard</source>
|
||||
<translation>链接已复制到剪贴板</translation>
|
||||
</message>
|
||||
|
Loading…
x
Reference in New Issue
Block a user