From af7990e069ae2431d8666af2ea815a87d2d60e5d Mon Sep 17 00:00:00 2001 From: shenmo Date: Sun, 26 Jun 2022 06:21:19 +0000 Subject: [PATCH] =?UTF-8?q?!43=20ss-apt-fast=E7=9B=B8=E5=85=B3=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=EF=BC=9A=E5=85=88=E8=A1=8C=E8=8E=B7=E5=8F=96mirror?= =?UTF-8?q?=E5=92=8C=E8=87=AA=E5=8A=A8=E5=AE=89=E8=A3=85apt-fast=20*=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=A4=9A=E4=BD=8D=E6=95=B0=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E6=98=BE=E7=A4=BA=20*=20=09modified:=20=20=20tool/upd?= =?UTF-8?q?ate-upgrade/ss-do-upgrade.sh=20*=20=09modified:=20=20=20tool/up?= =?UTF-8?q?date-upgrade/ss-do-upgrade.sh=20*=20=E6=9B=B4=E6=94=B9=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E5=88=A4=E6=96=AD=E6=96=B9=E6=B3=95=20*=20=09modified?= =?UTF-8?q?:=20=20=20debian/changelog=20*=20*=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=EF=BC=9Assinstall=E7=8E=B0=E5=9C=A8=E4=BC=9A=E5=9C=A8=E6=B2=A1?= =?UTF-8?q?=E6=9C=89apt-fast=E7=9A=84=E6=97=B6=E5=80=99=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=AE=89=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 16 +++++++++ src/main.cpp | 4 +-- tool/apt-fast-conf/apt-fast.conf | 2 +- tool/ss-apt-fast | 20 ++++++++--- tool/ssinstall | 33 ++++++++----------- tool/update-upgrade/ss-do-upgrade.sh | 12 +++---- tool/update-upgrade/ss-update-controler.sh | 6 ---- .../update-upgrade/ss-update-notify-placer.sh | 2 +- 8 files changed, 55 insertions(+), 40 deletions(-) diff --git a/debian/changelog b/debian/changelog index 519ee27..2e5ce7f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,19 @@ +spark-store (3.2) stable; urgency=medium + + + + 新增:ssinstall现在会在没有apt-fast的时候自动安装 + 新增:ss-apt-fast现在会在没有apt-fast的时候自动安装 + 修改:删除ssinstall中无用的 || dpkg -P $1 + 新增:ss-apt-fast会先下载云上的conf以确保mirror是最新的 + 修复:去除wget指令 + + + + -- shenmo Mon, 17 Jan 2022 00:00:00 +0800 + + + spark-store (3.1.2) stable; urgency=medium * Now let apt-fast method support all mirrors diff --git a/src/main.cpp b/src/main.cpp index f070125..35d72e6 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.2")); + dialog.setVersion(DApplication::buildVersion("Version 3.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.2")); + a.setApplicationVersion(DApplication::buildVersion("3.2")); a.setApplicationAcknowledgementPage("https://gitee.com/deepin-community-store/spark-store"); a.setApplicationDescription( QObject::tr( diff --git a/tool/apt-fast-conf/apt-fast.conf b/tool/apt-fast-conf/apt-fast.conf index c184622..0139d67 100644 --- a/tool/apt-fast-conf/apt-fast.conf +++ b/tool/apt-fast-conf/apt-fast.conf @@ -54,7 +54,7 @@ DOWNLOADBEFORE=true # # Default: disabled # -MIRRORS=( 'https://d.store.deepinos.org.cn/,https://d1.store.deepinos.org.cn/,https://d2.store.deepinos.org.cn/,https://d3.store.deepinos.org.cn/,https://d4.store.deepinos.org.cn/,https://d5.store.deepinos.org.cn/' ) +MIRRORS=( 'https://d.store.deepinos.org.cn/,https://d1.store.deepinos.org.cn/,https://d2.store.deepinos.org.cn/,https://d3.store.deepinos.org.cn/,https://d4.store.deepinos.org.cn/,https://d5.store.deepinos.org.cn/,http://cdn.dl.uniartisan.com:9000/deepinos/' ) # Maximum number of connections diff --git a/tool/ss-apt-fast b/tool/ss-apt-fast index a7d2ac4..7b8ad2e 100755 --- a/tool/ss-apt-fast +++ b/tool/ss-apt-fast @@ -1,8 +1,18 @@ #/bin/bash -DEPEND=`dpkg -l | grep apt-fast` -if [ "$DEPEND" = "" ] ; then -echo "未安装依赖:apt-fast 本脚本退出" -exit 0 + +if [ "$(id -u)" != "0" ] +then + echo "ss-apt-fast需要在root下运行" + exit fi -sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/apt-fast.conf' /etc/apt-fast.conf apt-fast "$@" \ No newline at end of file +DEPEND=`which apt-fast` +if [ "$DEPEND" = "" ] ; then +echo "未安装依赖:apt-fast 开始安装" +apt install apt-fast -y +fi + +rm /opt/durapps/spark-store/bin/apt-fast-conf/apt-fast.conf +curl -o /opt/durapps/spark-store/bin/apt-fast-conf/apt-fast.conf "https://gitee.com/deepin-community-store/repo_auto_update_script/raw/master/mirror-list-for-apt-fast/apt-fast.conf" + +bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/apt-fast.conf' /etc/apt-fast.conf apt-fast "$@" \ No newline at end of file diff --git a/tool/ssinstall b/tool/ssinstall index 9331981..d7c474e 100755 --- a/tool/ssinstall +++ b/tool/ssinstall @@ -38,10 +38,8 @@ fi - - ##################apt-fast/metalink测试 -DEPEND=`which apt-fast` +DEPEND="这里一定会安装所以放弃处理" isuos=`cat /etc/os-release | grep UnionTech` @@ -51,25 +49,24 @@ if [ "$(id -u)" != "0" ];then #临时提升星火源的优先级 echo "$upass" | sudo -S sed -i 's/400/500/g' /etc/apt/preferences.d/sparkstore -if [ "$DEPEND" = "" ] ; then -echo "没有检测到apt-fast组件,将会使用单线程下载依赖" -echo "你可以安装apt-fast来加速下载(对UOS无效)" -echo "若要使用apt-fast加速下载,请在安装apt-fast时选择使用apt并选择略过确认对话框" -echo ---------------------------------------------------------------------------------- -echo "$upass" | sudo -S dpkg -i $1 || apt install -yf || dpkg -P $1 +IS_INSTALLED=`which apt-fast` +if [ "$IS_INSTALLED" = "" ] ; then +echo "未安装依赖:apt-fast 开始安装" +echo "$upass" | sudo -S apt install apt-fast -y fi + if [ "$DEPEND" != "" ] && [ "$isuos" != "" ]; then echo "UOS中系统依赖无法使用第三方下载工具,放弃使用apt-fast" echo ---------------------------------------------------------------------------------- -echo "$upass" | sudo -S dpkg -i $1 || apt install -yf || dpkg -P $1 +echo "$upass" | sudo -S dpkg -i $1 || apt install -yf fi if [ "$DEPEND" != "" ] && [ "$isuos" = "" ]; then echo "检测到apt-fast,使用ss-apt-fast进行多线程下载加速" echo ---------------------------------------------------------------------------------- -echo "$upass" | sudo -S dpkg -i $1 || ss-apt-fast install -yf || dpkg -P $1 +echo "$upass" | sudo -S dpkg -i $1 || ss-apt-fast install -yf fi echo "$upass" | sudo -S sed -i 's/500/400/g' /etc/apt/preferences.d/sparkstore @@ -83,25 +80,23 @@ else #临时提升星火源的优先级 sed -i 's/400/500/g' /etc/apt/preferences.d/sparkstore -if [ "$DEPEND" = "" ] ; then -echo "没有检测到apt-fast组件,将会使用单线程下载依赖" -echo "你可以安装apt-fast来加速下载(对UOS无效)" -echo "若要使用apt-fast加速下载,请在安装apt-fast时选择使用apt并选择略过确认对话框" -echo ---------------------------------------------------------------------------------- -dpkg -i $1 || apt install -yf || dpkg -P $1 +IS_INSTALLED=`which apt-fast` +if [ "$IS_INSTALLED" = "" ] ; then +echo "未安装依赖:apt-fast 开始安装" +apt install apt-fast -y fi if [ "$DEPEND" != "" ] && [ "$isuos" != "" ]; then echo "UOS中系统依赖无法使用第三方下载工具,放弃使用apt-fast" echo ---------------------------------------------------------------------------------- -dpkg -i $1 || apt install -yf || dpkg -P $1 +dpkg -i $1 || apt install -yf fi if [ "$DEPEND" != "" ] && [ "$isuos" = "" ]; then echo "检测到apt-fast,使用ss-apt-fast进行多线程下载加速" echo ---------------------------------------------------------------------------------- -dpkg -i $1 || ss-apt-fast install -yf || dpkg -P $1 +dpkg -i $1 || ss-apt-fast install -yf fi sed -i 's/500/400/g' /etc/apt/preferences.d/sparkstore diff --git a/tool/update-upgrade/ss-do-upgrade.sh b/tool/update-upgrade/ss-do-upgrade.sh index 9bae2bd..28df4b1 100755 --- a/tool/update-upgrade/ss-do-upgrade.sh +++ b/tool/update-upgrade/ss-do-upgrade.sh @@ -1,9 +1,9 @@ #!/bin/bash -DEPEND=`which apt-fast` -if [ "$DEPEND" = "" ] ; then -echo "没有安装apt-fast,使用apt运行" -sudo apt upgrade -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" + +echo "以上可升级,是否升级?[y/n]" +read yes_or_no +if [ "$yes_or_no" = "y" ];then +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 -echo "已安装apt-fast,使用apt-fast加速运行" -ss-apt-fast upgrade -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" +exit 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 91256d4..e2b83e8 100755 --- a/tool/update-upgrade/ss-update-controler.sh +++ b/tool/update-upgrade/ss-update-controler.sh @@ -30,12 +30,6 @@ echo "输入2 查看可更新软件包列表并决定是否更新" echo "输入3 $text_auto_install_open点击安装免输入密码功能" echo "输入4 退出脚本" echo -echo "小提示:建议安装apt-fast以提高下载速度。" -echo "安装过apt-fast的用户可在系统更新的时候使用ss-apt-fast代替apt-fast进行更新" -echo "比如 sudo ss-apt-fast update或者sudo ss-apt-fast upgrade" -echo -echo "UOS除外:UOS对下载源采取了禁止非APT应用多线程下载的策略" -echo "为了防止系统依赖包无法下载,在依赖下载时禁用了apt-fast." read option case $option in diff --git a/tool/update-upgrade/ss-update-notify-placer.sh b/tool/update-upgrade/ss-update-notify-placer.sh index 6ed2861..0f783e1 100755 --- a/tool/update-upgrade/ss-update-notify-placer.sh +++ b/tool/update-upgrade/ss-update-notify-placer.sh @@ -50,7 +50,7 @@ fi update_app_number=`echo ${updatetext%package*} #从右向左截取第一个 src 后的字符串` -update_app_number=`echo ${update_app_number: -1}` +update_app_number=`echo ${update_app_number##*information...}` sudo echo "$update_app_number" > /tmp/spark-store-updatenum/number