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/