From 0c367799b70095488ae77750d690a4012bfbf832 Mon Sep 17 00:00:00 2001 From: shenmo Date: Mon, 8 Aug 2022 04:35:58 +0000 Subject: [PATCH 1/8] =?UTF-8?q?!70=20=E4=BF=AE=E5=A4=8D=EF=BC=9Assinstall?= =?UTF-8?q?=E5=9C=A8=E6=B2=A1=E6=9C=89=E5=AE=89=E8=A3=85apt-fast=E7=9A=84?= =?UTF-8?q?=E6=83=85=E5=86=B5=E4=B8=8B=E9=A6=96=E6=AC=A1=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E4=BE=9D=E8=B5=96=E7=9A=84=E8=BD=AF=E4=BB=B6?= =?UTF-8?q?=E6=97=B6=E5=AE=89=E8=A3=85=E5=A4=B1=E8=B4=A5=20*=20=09?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20debian/changelog=20*?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=EF=BC=9Assinstall=E5=9C=A8=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=AE=89=E8=A3=85apt-fast=E7=9A=84=E6=83=85=E5=86=B5?= =?UTF-8?q?=E4=B8=8B=E9=A6=96=E6=AC=A1=E5=AE=89=E8=A3=85=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E7=9A=84=E8=BD=AF=E4=BB=B6=E6=97=B6=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 2 +- tool/ss-apt-fast | 2 +- tool/ssinstall | 12 ++++++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7351f6b..2cba1f9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,7 @@ spark-store (3.1.4-1) stable; urgency=medium * 安装脚本和检测更新脚本检查网络时间超时时间延长至5s - + * 修复:ssinstall在没有安装apt-fast的情况下首次安装需要依赖的软件时安装失败 -- shenmo Fri, 30 Jan 2022 00:00:00 +0800 diff --git a/tool/ss-apt-fast b/tool/ss-apt-fast index ca6293c..fd619ee 100755 --- a/tool/ss-apt-fast +++ b/tool/ss-apt-fast @@ -18,7 +18,7 @@ chmod -R 755 /tmp/ss-apt-fast-conf DEPEND=`which apt-fast` if [ "$DEPEND" = "" ] ; then echo "未安装依赖:apt-fast 开始安装" -sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt update && sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt install apt-fast -y +sudo ss-apt-fast ssupdate && sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt install apt-fast -y fi ###执行安装 bwrap --dev-bind / / \ diff --git a/tool/ssinstall b/tool/ssinstall index e57a6c9..34d0932 100755 --- a/tool/ssinstall +++ b/tool/ssinstall @@ -47,7 +47,12 @@ isuos=`cat /etc/os-release | grep UnionTech` if [ "$(id -u)" != "0" ];then #############################无root权限时 +IS_INSTALLED=`which apt-fast` +if [ "$IS_INSTALLED" = "" ] ; then +echo "未安装依赖:apt-fast 开始安装" +echo "$upass" | sudo -S /usr/local/bin/ss-apt-fast ssupdate && echo "$upass" | sudo -S bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt install apt-fast -y +fi if [ "$DEPEND" != "" ] && [ "$isuos" != "" ]; then echo "UOS中系统依赖无法使用第三方下载工具,放弃使用apt-fast" @@ -70,8 +75,11 @@ fi else ###########################有root权限时 - - +IS_INSTALLED=`which apt-fast` +if [ "$IS_INSTALLED" = "" ] ; then +echo "未安装依赖:apt-fast 开始安装" +/usr/local/bin/ss-apt-fast ssupdate && bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt install apt-fast -y +fi if [ "$DEPEND" != "" ] && [ "$isuos" != "" ]; then echo "UOS中系统依赖无法使用第三方下载工具,放弃使用apt-fast" From c826a3927c287b2732ee4e080e1e0ee15b9715c4 Mon Sep 17 00:00:00 2001 From: Pluto Date: Mon, 8 Aug 2022 04:49:17 +0000 Subject: [PATCH 2/8] =?UTF-8?q?!69=20metalink=20=E5=8A=9F=E8=83=BD=20*=20f?= =?UTF-8?q?eature:=20metalink=20backhend=20*=20Merge=20remote-tracking=20b?= =?UTF-8?q?ranch=20'upstream/master'=20into=20dev=20*=20Merge=20remote-tra?= =?UTF-8?q?cking=20branch=20'upstream/master'=20into=20dev=20*=20fix:=20?= =?UTF-8?q?=E5=BF=BD=E7=95=A5=E7=B3=BB=E7=BB=9F=E5=8E=9F=E6=9C=89aria2?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=20*=20fix:=20waitforfinish?= =?UTF-8?q?ed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/downloadworker.cpp | 112 +++++++++++++++++++++++++---------------- 1 file changed, 70 insertions(+), 42 deletions(-) diff --git a/src/downloadworker.cpp b/src/downloadworker.cpp index bbfd2e7..460fb1d 100644 --- a/src/downloadworker.cpp +++ b/src/downloadworker.cpp @@ -44,6 +44,48 @@ void timeSleeper(int time) return; } +bool checkMeatlink(QString metaUrl) +{ + QFile metaStatus("/tmp/spark-store/metaStatus.txt"); + if (metaStatus.exists()) + { + metaStatus.remove(); + } + system("curl -I -s --connect-timeout 5 " + metaUrl.toUtf8() + " -w %{http_code} |tail -n1 > /tmp/spark-store/metaStatus.txt"); + if (metaStatus.open(QFile::ReadOnly) && QString(metaStatus.readAll()).toUtf8() == "200") + { + metaStatus.remove(); + return true; + } + return false; +} + +void gennerateDomain(QVector &domains) +{ + QFile serverList(QDir::homePath().toUtf8() + "/.config/spark-store/server.list"); + if (serverList.open(QFile::ReadOnly)) + { + QStringList list = QString(serverList.readAll()).trimmed().split("\n"); + qDebug() << list << list.size(); + domains.clear(); + + for (int i = 0; i < list.size(); i++) + { + if (list.at(i).contains("镜像源 Download only") && i + 1 < list.size()) + { + for (int j = i + 1; j < list.size(); j++) + { + domains.append(list.at(j)); + } + break; + } + } + if (domains.size() == 0) + { + domains.append("d.store.deepinos.org.cn"); + } + } +} /** * @brief 开始下载 @@ -59,54 +101,37 @@ void DownloadController::startDownload(const QString &url) } QtConcurrent::run([=]() - { - QFile serverList(QDir::homePath().toUtf8() + "/.config/spark-store/server.list"); - if (serverList.open(QFile::ReadOnly)) - { - QStringList list = QString(serverList.readAll()).trimmed().split("\n"); - qDebug() << list << list.size(); - domains.clear(); - - for (int i = 0; i < list.size(); i++) - { - if (list.at(i).contains("镜像源 Download only") && i + 1 < list.size()) - { - for (int j = i + 1; j < list.size(); j++) - { - system("curl -I -s --connect-timeout 5 https://" + list.at(j).toUtf8() + "/dcs-repo.gpg-key.asc -w %{http_code} |tail -n1 > /tmp/spark-store/cdnStatus.txt"); - QFile cdnStatus("/tmp/spark-store/cdnStatus.txt"); - if (cdnStatus.open(QFile::ReadOnly) && QString(cdnStatus.readAll()).toUtf8() == "200") - { - qDebug() << list.at(j); - domains.append(list.at(j)); - } - } - break; - } - } - if (domains.size() == 0) - { - domains.append("d.store.deepinos.org.cn"); - } - qDebug() << domains << domains.size(); + { + QString metaUrl = url + ".metalink"; + qDebug() << "metalink" << metaUrl; + bool useMetalink = false; + if (checkMeatlink(metaUrl)){ + useMetalink = true; + qDebug() << "useMetalink:" << useMetalink; + }else{ + gennerateDomain(domains); + // qDebug() << domains << domains.size(); } - QDir tmpdir("/tmp/spark-store/"); QString aria2Command = "-d"; QString aria2Urls = ""; QString aria2Verbose = "--summary-interval=1"; - QString aria2Threads = "-s " + QString::number(domains.size()); + QString aria2Threads = "--split=16"; QString aria2NoConfig = "--no-conf"; + QString aria2NoSeeds = "--seed-time=0"; QStringList command; QString downloadDir = "/tmp/spark-store/"; - - for (int i = 0; i < domains.size(); i++) - { - command.append(replaceDomain(url, domains.at(i)).toUtf8()); - aria2Urls += replaceDomain(url, domains.at(i)); - aria2Urls += " "; + if (useMetalink){ + command.append(metaUrl.toUtf8()); } + else{ + for (int i = 0; i < domains.size(); i++) + { + command.append(replaceDomain(url, domains.at(i)).toUtf8()); + } + } + qint64 downloadSizeRecord = 0; QString speedInfo = ""; @@ -114,8 +139,11 @@ void DownloadController::startDownload(const QString &url) command.append(aria2Command.toUtf8()); command.append(downloadDir.toUtf8()); command.append(aria2Verbose.toUtf8()); - command.append(aria2Threads.toUtf8()); command.append(aria2NoConfig.toUtf8()); + command.append(aria2Threads.toUtf8()); + if (useMetalink){ + command.append(aria2NoSeeds.toUtf8()); + } qDebug() << command; auto cmd = new QProcess(); cmd->setProcessChannelMode(QProcess::MergedChannels); @@ -130,6 +158,7 @@ void DownloadController::startDownload(const QString &url) //通过读取输出计算下载速度 QFileInfo info(tmpdir.absoluteFilePath(filename)); QString message = cmd->readAllStandardOutput().data(); + //qDebug() << message; message = message.replace(" ", "").replace("\n", "").replace("-", ""); message = message.replace("*", "").replace("=", ""); QStringList list; @@ -153,7 +182,7 @@ void DownloadController::startDownload(const QString &url) speedInfo = message.mid(speedPlace1 + 3, speedPlace2 - speedPlace1 - 3); speedInfo += "/s"; } - qDebug() << percentInfo << speedInfo; + // qDebug() << percentInfo << speedInfo; if (downloadSize >= downloadSizeRecord) { downloadSizeRecord = downloadSize; @@ -182,8 +211,7 @@ void DownloadController::startDownload(const QString &url) { continue; } - emit downloadFinished(); - }); + emit downloadFinished(); }); } /** From e2f6a2b3c2d2621aeaa1639da8ae5441f09c5a7c Mon Sep 17 00:00:00 2001 From: shenmo Date: Mon, 8 Aug 2022 04:50:47 +0000 Subject: [PATCH 3/8] =?UTF-8?q?!71=203142=E5=87=86=E5=A4=87=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=20*=203142=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index 2cba1f9..f23b26c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +spark-store (3.1.4-2) stable; urgency=medium + + * 客户端下载使用metalink来支持bt下载加速 + + +-- shenmo Fri, 30 Jan 2022 00:00:00 +0800 + spark-store (3.1.4-1) stable; urgency=medium * 安装脚本和检测更新脚本检查网络时间超时时间延长至5s From b639a9d72654b8200ab591dedca965936ae06e10 Mon Sep 17 00:00:00 2001 From: shenmo Date: Tue, 9 Aug 2022 10:35:33 +0000 Subject: [PATCH 4/8] =?UTF-8?q?!72=20*=20=E4=BF=AE=E5=A4=8D=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=9B=B4=E6=96=B0=E5=92=8C=E5=AE=89=E8=A3=85=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E6=9B=B4=E6=96=B0=E5=95=86=E5=BA=97=E6=9C=AC=E4=BD=93?= =?UTF-8?q?=E6=97=B6=E5=87=BA=E9=94=99=20*=20*=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=9B=B4=E6=96=B0=E5=92=8C=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=9B=B4=E6=96=B0=E5=95=86=E5=BA=97=E6=9C=AC?= =?UTF-8?q?=E4=BD=93=E6=97=B6=E5=87=BA=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 1 + tool/update-upgrade/ss-do-upgrade.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index f23b26c..c05bf2f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ spark-store (3.1.4-2) stable; urgency=medium * 客户端下载使用metalink来支持bt下载加速 + * 修复使用更新和安装设置更新商店本体时出错 -- shenmo Fri, 30 Jan 2022 00:00:00 +0800 diff --git a/tool/update-upgrade/ss-do-upgrade.sh b/tool/update-upgrade/ss-do-upgrade.sh index 7b9db92..2013b2c 100755 --- a/tool/update-upgrade/ss-do-upgrade.sh +++ b/tool/update-upgrade/ss-do-upgrade.sh @@ -6,7 +6,7 @@ if [ "$yes_or_no" = "y" ];then mkdir -p /tmp/ss-apt-fast-conf/sources.list.d -sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list ss-apt-fast upgrade -y -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" +sudo ss-apt-fast upgrade -y -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" else From 5e88f7c1eba79842d00202143bb2915b1f846162 Mon Sep 17 00:00:00 2001 From: shenmo Date: Tue, 9 Aug 2022 11:08:02 +0000 Subject: [PATCH 5/8] =?UTF-8?q?!73=203142=E7=89=88=E6=9C=AC=E5=8F=B7=20*?= =?UTF-8?q?=203142=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index f160c21..6f93aba 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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.1.4-1")); + dialog.setVersion(DApplication::buildVersion("Version 3.1.4-2")); 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.1.4-1")); + a.setApplicationVersion(DApplication::buildVersion("3.1.4-2")); a.setApplicationAcknowledgementPage("https://gitee.com/deepin-community-store/spark-store"); a.setApplicationDescription( QObject::tr( From 0c0ff452aefe6db54d25dc9e3af46dc382b2847c Mon Sep 17 00:00:00 2001 From: shenmo Date: Tue, 9 Aug 2022 11:27:38 +0000 Subject: [PATCH 6/8] =?UTF-8?q?!74=20=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20?= =?UTF-8?q?=20=20=20debian/spark-store.prerm=20=E6=96=B0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=EF=BC=9A=20=20=20tool/apt-fast-conf/sources.list.d/.keep=20?= =?UTF-8?q?=E5=88=A0=E9=99=A4=EF=BC=9A=20=20=20=20=20tool/apt-fast-conf/so?= =?UTF-8?q?urces.list.d/sparkstore.list=20*=20=09=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9A=20=20=20=20=20debian/spark-store.prerm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/spark-store.prerm | 1 + tool/apt-fast-conf/sources.list.d/.keep | 0 tool/apt-fast-conf/sources.list.d/sparkstore.list | 1 - 3 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 tool/apt-fast-conf/sources.list.d/.keep delete mode 100644 tool/apt-fast-conf/sources.list.d/sparkstore.list diff --git a/debian/spark-store.prerm b/debian/spark-store.prerm index a71edca..6998d1a 100755 --- a/debian/spark-store.prerm +++ b/debian/spark-store.prerm @@ -8,6 +8,7 @@ rm /usr/local/bin/ussinstall rm /usr/local/bin/ussremove rm /usr/local/bin/ss-apt-fast + # Remove residual symbol links to stop upgrade detect if exist if [ -f /etc/xdg/autostart/spark-update-notifier.desktop ];then rm /etc/xdg/autostart/spark-update-notifier.desktop diff --git a/tool/apt-fast-conf/sources.list.d/.keep b/tool/apt-fast-conf/sources.list.d/.keep new file mode 100644 index 0000000..e69de29 diff --git a/tool/apt-fast-conf/sources.list.d/sparkstore.list b/tool/apt-fast-conf/sources.list.d/sparkstore.list deleted file mode 100644 index 0563772..0000000 --- a/tool/apt-fast-conf/sources.list.d/sparkstore.list +++ /dev/null @@ -1 +0,0 @@ -deb [by-hash=force] https://d.store.deepinos.org.cn / From 398cd512d705349847c075a86e98e7f5c7687fb1 Mon Sep 17 00:00:00 2001 From: shenmo Date: Mon, 15 Aug 2022 14:54:03 +0000 Subject: [PATCH 7/8] =?UTF-8?q?!76=20=20=20*=20=E6=94=B9=E5=8F=98=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=AD=96=E7=95=A5=EF=BC=8C=E7=8E=B0=E5=9C=A8=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=BA=94=E7=94=A8=E5=9C=A8=E6=9B=B4=E6=96=B0=E6=97=B6?= =?UTF-8?q?=E5=BC=95=E5=85=A5=E6=96=B0=E4=BE=9D=E8=B5=96=20*=20ss-apt-fast?= =?UTF-8?q?=E7=8E=B0=E5=9C=A8=E9=BB=98=E8=AE=A4=E5=85=81=E8=AE=B8=E9=99=8D?= =?UTF-8?q?=E7=BA=A7=EF=BC=8C=E4=BB=A5=E4=B8=8Eapt=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E4=BD=93=E9=AA=8C=E4=B8=80=E8=87=B4=20*=20=20=20*=20=E6=94=B9?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=E6=96=B0=E7=AD=96=E7=95=A5=EF=BC=8C=E7=8E=B0?= =?UTF-8?q?=E5=9C=A8=E6=94=AF=E6=8C=81=E5=BA=94=E7=94=A8=E5=9C=A8=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=97=B6=E5=BC=95=E5=85=A5=E6=96=B0=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 8 +++++ src/main.cpp | 4 +-- tool/ss-apt-fast | 2 +- tool/update-upgrade/ss-do-upgrade.sh | 40 ++++++++++++++++++---- tool/update-upgrade/ss-update-controler.sh | 3 +- 5 files changed, 46 insertions(+), 11 deletions(-) diff --git a/debian/changelog b/debian/changelog index c05bf2f..0b3b4d6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +spark-store (3.1.5) stable; urgency=medium + + * 改变更新策略,现在支持应用在更新时引入新依赖 + * ss-apt-fast现在默认允许降级,以与apt使用体验一致 + + +-- shenmo Fri, 30 Jan 2022 00:00:00 +0800 + spark-store (3.1.4-2) stable; urgency=medium * 客户端下载使用metalink来支持bt下载加速 diff --git a/src/main.cpp b/src/main.cpp index 6f93aba..13d1361 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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.1.4-2")); + dialog.setVersion(DApplication::buildVersion("Version 3.1.5")); 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.1.4-2")); + a.setApplicationVersion(DApplication::buildVersion("3.1.5")); a.setApplicationAcknowledgementPage("https://gitee.com/deepin-community-store/spark-store"); a.setApplicationDescription( QObject::tr( diff --git a/tool/ss-apt-fast b/tool/ss-apt-fast index fd619ee..8e3299f 100755 --- a/tool/ss-apt-fast +++ b/tool/ss-apt-fast @@ -24,7 +24,7 @@ fi bwrap --dev-bind / / \ --bind '/tmp/ss-apt-fast-conf/apt-fast.conf' /etc/apt-fast.conf \ --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list \ - apt-fast "$@" + apt-fast "$@" --allow-downgrades rm -rf /tmp/ss-apt-fast-conf diff --git a/tool/update-upgrade/ss-do-upgrade.sh b/tool/update-upgrade/ss-do-upgrade.sh index 2013b2c..dd883bb 100755 --- a/tool/update-upgrade/ss-do-upgrade.sh +++ b/tool/update-upgrade/ss-do-upgrade.sh @@ -2,13 +2,41 @@ echo "以上可升级,是否升级?[y/n]" read yes_or_no -if [ "$yes_or_no" = "y" ];then -mkdir -p /tmp/ss-apt-fast-conf/sources.list.d +if [ "$yes_or_no" = "y" ];then ###这是确定是否同意 + +echo "获取更新列表..." +PKG_LIST="$(bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt list --upgradable -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" | awk 'BEGIN {FS="/"} {print $1}' | awk NR\>1)" -sudo ss-apt-fast upgrade -y -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" +isuos=`cat /etc/os-release | grep UnionTech` +if [ "$isuos" != "" ]; then ###这是确定是否为UOS +echo "UOS中系统依赖无法使用第三方下载工具,放弃使用apt-fast" + + for PKG_NAME in $PKG_LIST; + do + echo "$PKG_NAME 正在准备更新..." + if sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt install "$PKG_NAME" -y >/dev/null 2>&1; + then + echo "$PKG_NAME 已更新" + else + echo "WARNING: $PKG_NAME 无法更新" + fi + done + +else ###这是确定是否为UOS + + for PKG_NAME in $PKG_LIST; + do + echo "$PKG_NAME 正在准备更新..." + if sudo /usr/local/bin/ss-apt-fast install "$PKG_NAME" -y >/dev/null 2>&1; + then + echo "$PKG_NAME 已更新" + else + echo "WARNING: $PKG_NAME 无法更新" + fi + done -else -exit -fi \ No newline at end of file +fi ###这是确定是否为UOS + +fi ###这是确定是否同意 \ No newline at end of file diff --git a/tool/update-upgrade/ss-update-controler.sh b/tool/update-upgrade/ss-update-controler.sh index 09c70f6..bcd8c46 100755 --- a/tool/update-upgrade/ss-update-controler.sh +++ b/tool/update-upgrade/ss-update-controler.sh @@ -71,10 +71,9 @@ case $option in ;; 2) - echo "请注意:如果有些更新需要从系统获取更多依赖,你将需要手动操作 sudo ss-apt-fast upgrade" echo "执行以下操作需要授权..." sudo ss-apt-fast ssupdate - /opt/durapps/spark-store/bin/update-upgrade/ss-upgrade-list.sh + /opt/durapps/spark-store/bin/update-upgrade/ss-upgrade-list.sh /opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade.sh echo "---请按回车返回" read From c9e01d10fed1e701ae23483ed953b35e8c81b170 Mon Sep 17 00:00:00 2001 From: shenmo Date: Wed, 17 Aug 2022 02:59:05 +0000 Subject: [PATCH 8/8] =?UTF-8?q?!77=20=E4=BF=AE=E6=94=B9uos=E7=9A=84?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=AD=96=E7=95=A5=EF=BC=8C=E5=85=88=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E5=88=B0/var/cache/apt/archives=E5=86=8D=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=20*=20=E4=BF=AE=E6=94=B9uos=E7=9A=84=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=AD=96=E7=95=A5=EF=BC=8C=E5=85=88=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E5=88=B0/var/cache/apt/archives=E5=86=8D=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 8 ++++++++ src/main.cpp | 4 ++-- tool/update-upgrade/ss-do-upgrade.sh | 14 ++++++++++++-- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0b3b4d6..624b891 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +spark-store (3.1.5-1) stable; urgency=medium + + * 改变更新策略,UOS也下载加速,但是安装不加速 + + + +-- shenmo Fri, 30 Jan 2022 00:00:00 +0800 + spark-store (3.1.5) stable; urgency=medium * 改变更新策略,现在支持应用在更新时引入新依赖 diff --git a/src/main.cpp b/src/main.cpp index 13d1361..be581da 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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.1.5")); + dialog.setVersion(DApplication::buildVersion("Version 3.1.5-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.1.5")); + a.setApplicationVersion(DApplication::buildVersion("3.1.5-1")); a.setApplicationAcknowledgementPage("https://gitee.com/deepin-community-store/spark-store"); a.setApplicationDescription( QObject::tr( diff --git a/tool/update-upgrade/ss-do-upgrade.sh b/tool/update-upgrade/ss-do-upgrade.sh index dd883bb..e599646 100755 --- a/tool/update-upgrade/ss-do-upgrade.sh +++ b/tool/update-upgrade/ss-do-upgrade.sh @@ -9,9 +9,17 @@ PKG_LIST="$(bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-c isuos=`cat /etc/os-release | grep UnionTech` -if [ "$isuos" != "" ]; then ###这是确定是否为UOS -echo "UOS中系统依赖无法使用第三方下载工具,放弃使用apt-fast" +if [ "$isuos" != "" ]; then ###这是确定是否为UOS 如果是 +echo "UOS中系统依赖无法使用第三方下载工具,使用apt-fast下载本体" + cd /var/cache/apt/archives + for PKG_NAME in $PKG_LIST; + do + echo "$PKG_NAME 正在下载..." + sudo /usr/local/bin/ss-apt-fast download "$PKG_NAME" -y >/dev/null 2>&1; + done + + echo "----开始安装" for PKG_NAME in $PKG_LIST; do echo "$PKG_NAME 正在准备更新..." @@ -23,6 +31,8 @@ echo "UOS中系统依赖无法使用第三方下载工具,放弃使用apt-fast fi done + + else ###这是确定是否为UOS for PKG_NAME in $PKG_LIST;