!63 修复UOS未处理模拟软件源,新增ss-apt-fast ssupdate,杂项调整

修复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 功能重复的内容转为调用
This commit is contained in:
shenmo 2022-08-05 01:34:27 +00:00
parent a63c1202bd
commit b0dfd6a3da
5 changed files with 35 additions and 36 deletions

2
debian/changelog vendored
View File

@ -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 <shenmo@spark-app.store> Fri, 30 Jan 2022 00:00:00 +0800

View File

@ -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 / / \
--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
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-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

View File

@ -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

View File

@ -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 "---请按回车返回"

View File

@ -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/