From b0dfd6a3dae15fa2f34cf349c4a5ad44e436a921 Mon Sep 17 00:00:00 2001 From: shenmo Date: Fri, 5 Aug 2022 01:34:27 +0000 Subject: [PATCH] =?UTF-8?q?!63=20=E4=BF=AE=E5=A4=8DUOS=E6=9C=AA=E5=A4=84?= =?UTF-8?q?=E7=90=86=E6=A8=A1=E6=8B=9F=E8=BD=AF=E4=BB=B6=E6=BA=90=EF=BC=8C?= =?UTF-8?q?=E6=96=B0=E5=A2=9Ess-apt-fast=20ssupdate=EF=BC=8C=E6=9D=82?= =?UTF-8?q?=E9=A1=B9=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复UOS未处理模拟软件源 删除ssinstall的apt-fast安装功能(转移到ss-apt-fast,并且不会再对UOS安装apt-fast) ss-apt-fast除了下载,安装和更新,全部走apt; ss-apt-fast现在只会在安装/下载/更新时检测是否有apt-fast并处理 ss-apt-fast ssupdate 从服务器获取源链接后只更新星火源; 和 ss-apt-fast ssupdate 功能重复的内容转为调用 --- debian/changelog | 2 + tool/ss-apt-fast | 41 +++++++++++-------- tool/ssinstall | 23 +++-------- tool/update-upgrade/ss-update-controler.sh | 3 +- .../update-upgrade/ss-update-notify-placer.sh | 2 +- 5 files changed, 35 insertions(+), 36 deletions(-) diff --git a/debian/changelog b/debian/changelog index f363937..66958a7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ spark-store (3.1.3-2) stable; urgency=medium * 调整 现在与系统更新分开,不再导致更新失败 * 支持直接更新软件源文件,不再让d.吃全部更新流量 * ss-apt-fast不再强制root权限 + * 修改ss-apt-fast的策略,现在除了安装,下载和更新都改用apt + * ssinstall 现在也会在不适用ss-apt-fast的时候模拟源了(针对UOS) -- shenmo Fri, 30 Jan 2022 00:00:00 +0800 diff --git a/tool/ss-apt-fast b/tool/ss-apt-fast index 311b5b6..d9827cd 100755 --- a/tool/ss-apt-fast +++ b/tool/ss-apt-fast @@ -1,33 +1,42 @@ #/bin/bash -DEPEND=`which apt-fast` -if [ "$DEPEND" = "" ] ; then -echo "未安装依赖:apt-fast 开始安装" -sudo apt install apt-fast -y -fi + +if [ "$1" = "install" ] || [ "$1" = "upgrade" ] || [ "$1" = "download" ] ; then + +###刷新apt-fast配置 mkdir -p /tmp/ss-apt-fast-conf/sources.list.d # 创建文件夹 echo "从服务器获取配置和镜像列表..." echo "Getting server and mirror lists..." echo - curl --progress-bar -o /tmp/ss-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" - - chmod -R 755 /tmp/ss-apt-fast-conf -if [[ $1 == "policy" ]]; then - bwrap --dev-bind / / \ + +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 +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 "$@" -else - 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 "$@" -fi rm -rf /tmp/ss-apt-fast-conf + +elif [ "$1" = "ssupdate" ];then +sudo curl --progress-bar -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "https://gitee.com/deepin-community-store/repo_auto_update_script/raw/master/mirror-list-for-apt-fast/sources.list.d/sparkstore.list" +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 -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" +#只更新星火源 + +else + 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 "$@" +fi + + diff --git a/tool/ssinstall b/tool/ssinstall index 38e3369..258c8c4 100755 --- a/tool/ssinstall +++ b/tool/ssinstall @@ -48,24 +48,19 @@ if [ "$(id -u)" != "0" ];then #############################无root权限时 -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 || sudo apt install -yf +echo "$upass" | sudo -S dpkg -i $1 || 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 -yf + + fi if [ "$DEPEND" != "" ] && [ "$isuos" = "" ]; then echo "检测到apt-fast,使用ss-apt-fast进行多线程下载加速" echo ---------------------------------------------------------------------------------- -echo "$upass" | sudo -S dpkg -i $1 || sudo ss-apt-fast install -yf +echo "$upass" | sudo -S dpkg -i $1 || sudo ss-apt-fast ssupdate && sudo ss-apt-fast install -yf fi @@ -77,23 +72,17 @@ else -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 -i $1 || 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 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 -yf fi if [ "$DEPEND" != "" ] && [ "$isuos" = "" ]; then echo "检测到apt-fast,使用ss-apt-fast进行多线程下载加速" echo ---------------------------------------------------------------------------------- -dpkg -i $1 || ss-apt-fast install -yf +dpkg -i $1 || ss-apt-fast ssupdate && ss-apt-fast install -yf fi diff --git a/tool/update-upgrade/ss-update-controler.sh b/tool/update-upgrade/ss-update-controler.sh index 9ad2c48..09c70f6 100755 --- a/tool/update-upgrade/ss-update-controler.sh +++ b/tool/update-upgrade/ss-update-controler.sh @@ -73,8 +73,7 @@ case $option in 2) echo "请注意:如果有些更新需要从系统获取更多依赖,你将需要手动操作 sudo ss-apt-fast upgrade" echo "执行以下操作需要授权..." - sudo curl --progress-bar -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "https://gitee.com/deepin-community-store/repo_auto_update_script/raw/master/mirror-list-for-apt-fast/sources.list.d/sparkstore.list" - 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 -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" + sudo ss-apt-fast ssupdate /opt/durapps/spark-store/bin/update-upgrade/ss-upgrade-list.sh /opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade.sh echo "---请按回车返回" diff --git a/tool/update-upgrade/ss-update-notify-placer.sh b/tool/update-upgrade/ss-update-notify-placer.sh index 244b738..ba0977a 100755 --- a/tool/update-upgrade/ss-update-notify-placer.sh +++ b/tool/update-upgrade/ss-update-notify-placer.sh @@ -39,7 +39,7 @@ fi curl --progress-bar -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "https://gitee.com/deepin-community-store/repo_auto_update_script/raw/master/mirror-list-for-apt-fast/sources.list.d/sparkstore.list" # 每日更新星火源文件 -updatetext=`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 -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"` +updatetext=`ss-apt-fast ssupdate` mkdir -p /tmp/spark-store-updatenum/