!43 ss-apt-fast相关改动:先行获取mirror和自动安装apt-fast

* 修复 多位数无法显示
* 	modified:   tool/update-upgrade/ss-do-upgrade.sh
* 	modified:   tool/update-upgrade/ss-do-upgrade.sh
* 更改依赖判断方法
* 	modified:   debian/changelog
* * 新增:ssinstall现在会在没有apt-fast的时候自动安装
This commit is contained in:
shenmo 2022-06-26 06:21:19 +00:00
parent f8dbca8f6f
commit af7990e069
8 changed files with 55 additions and 40 deletions

16
debian/changelog vendored
View File

@ -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 <shenmo@spark-app.store> Mon, 17 Jan 2022 00:00:00 +0800
spark-store (3.1.2) stable; urgency=medium spark-store (3.1.2) stable; urgency=medium
* Now let apt-fast method support all mirrors * Now let apt-fast method support all mirrors

View File

@ -30,7 +30,7 @@ int main(int argc, char *argv[])
DAboutDialog dialog; DAboutDialog dialog;
a.setAboutDialog(&dialog); a.setAboutDialog(&dialog);
dialog.setLicense(QObject::tr("We publish this program under GPL V3")); 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.setProductIcon(QIcon::fromTheme("spark-store")); // 设置Logo
dialog.setProductName(QLabel::tr("Spark Store")); dialog.setProductName(QLabel::tr("Spark Store"));
dialog.setDescription( dialog.setDescription(
@ -51,7 +51,7 @@ int main(int argc, char *argv[])
a.setOrganizationName("spark-union"); a.setOrganizationName("spark-union");
a.setOrganizationDomain("https://www.deepinos.org/"); a.setOrganizationDomain("https://www.deepinos.org/");
a.setApplicationName("Spark Store"); //不需要翻译,否则 ~/.local/share/ 下文件夹名称也被翻译为中文 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.setApplicationAcknowledgementPage("https://gitee.com/deepin-community-store/spark-store");
a.setApplicationDescription( a.setApplicationDescription(
QObject::tr( QObject::tr(

View File

@ -54,7 +54,7 @@ DOWNLOADBEFORE=true
# #
# Default: disabled # 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 # Maximum number of connections

View File

@ -1,8 +1,18 @@
#/bin/bash #/bin/bash
DEPEND=`dpkg -l | grep apt-fast`
if [ "$DEPEND" = "" ] ; then if [ "$(id -u)" != "0" ]
echo "未安装依赖apt-fast 本脚本退出" then
exit 0 echo "ss-apt-fast需要在root下运行"
exit
fi fi
sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/apt-fast.conf' /etc/apt-fast.conf apt-fast "$@" 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 "$@"

View File

@ -38,10 +38,8 @@ fi
##################apt-fast/metalink测试 ##################apt-fast/metalink测试
DEPEND=`which apt-fast` DEPEND="这里一定会安装所以放弃处理"
isuos=`cat /etc/os-release | grep UnionTech` 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 echo "$upass" | sudo -S sed -i 's/400/500/g' /etc/apt/preferences.d/sparkstore
if [ "$DEPEND" = "" ] ; then IS_INSTALLED=`which apt-fast`
echo "没有检测到apt-fast组件将会使用单线程下载依赖" if [ "$IS_INSTALLED" = "" ] ; then
echo "你可以安装apt-fast来加速下载对UOS无效" echo "未安装依赖apt-fast 开始安装"
echo "若要使用apt-fast加速下载请在安装apt-fast时选择使用apt并选择略过确认对话框" echo "$upass" | sudo -S apt install apt-fast -y
echo ----------------------------------------------------------------------------------
echo "$upass" | sudo -S dpkg -i $1 || apt install -yf || dpkg -P $1
fi fi
if [ "$DEPEND" != "" ] && [ "$isuos" != "" ]; then if [ "$DEPEND" != "" ] && [ "$isuos" != "" ]; then
echo "UOS中系统依赖无法使用第三方下载工具放弃使用apt-fast" echo "UOS中系统依赖无法使用第三方下载工具放弃使用apt-fast"
echo ---------------------------------------------------------------------------------- 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 fi
if [ "$DEPEND" != "" ] && [ "$isuos" = "" ]; then if [ "$DEPEND" != "" ] && [ "$isuos" = "" ]; then
echo "检测到apt-fast使用ss-apt-fast进行多线程下载加速" echo "检测到apt-fast使用ss-apt-fast进行多线程下载加速"
echo ---------------------------------------------------------------------------------- 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 fi
echo "$upass" | sudo -S sed -i 's/500/400/g' /etc/apt/preferences.d/sparkstore 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 sed -i 's/400/500/g' /etc/apt/preferences.d/sparkstore
if [ "$DEPEND" = "" ] ; then IS_INSTALLED=`which apt-fast`
echo "没有检测到apt-fast组件将会使用单线程下载依赖" if [ "$IS_INSTALLED" = "" ] ; then
echo "你可以安装apt-fast来加速下载对UOS无效" echo "未安装依赖apt-fast 开始安装"
echo "若要使用apt-fast加速下载请在安装apt-fast时选择使用apt并选择略过确认对话框" apt install apt-fast -y
echo ----------------------------------------------------------------------------------
dpkg -i $1 || apt install -yf || dpkg -P $1
fi fi
if [ "$DEPEND" != "" ] && [ "$isuos" != "" ]; then if [ "$DEPEND" != "" ] && [ "$isuos" != "" ]; then
echo "UOS中系统依赖无法使用第三方下载工具放弃使用apt-fast" echo "UOS中系统依赖无法使用第三方下载工具放弃使用apt-fast"
echo ---------------------------------------------------------------------------------- echo ----------------------------------------------------------------------------------
dpkg -i $1 || apt install -yf || dpkg -P $1 dpkg -i $1 || apt install -yf
fi fi
if [ "$DEPEND" != "" ] && [ "$isuos" = "" ]; then if [ "$DEPEND" != "" ] && [ "$isuos" = "" ]; then
echo "检测到apt-fast使用ss-apt-fast进行多线程下载加速" echo "检测到apt-fast使用ss-apt-fast进行多线程下载加速"
echo ---------------------------------------------------------------------------------- echo ----------------------------------------------------------------------------------
dpkg -i $1 || ss-apt-fast install -yf || dpkg -P $1 dpkg -i $1 || ss-apt-fast install -yf
fi fi
sed -i 's/500/400/g' /etc/apt/preferences.d/sparkstore sed -i 's/500/400/g' /etc/apt/preferences.d/sparkstore

View File

@ -1,9 +1,9 @@
#!/bin/bash #!/bin/bash
DEPEND=`which apt-fast`
if [ "$DEPEND" = "" ] ; then echo "以上可升级,是否升级?[y/n]"
echo "没有安装apt-fast使用apt运行" read yes_or_no
sudo apt upgrade -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" 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 else
echo "已安装apt-fast使用apt-fast加速运行" exit
ss-apt-fast upgrade -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
fi fi

View File

@ -30,12 +30,6 @@ echo "输入2 查看可更新软件包列表并决定是否更新"
echo "输入3 $text_auto_install_open点击安装免输入密码功能" echo "输入3 $text_auto_install_open点击安装免输入密码功能"
echo "输入4 退出脚本" echo "输入4 退出脚本"
echo 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 read option
case $option in case $option in

View File

@ -50,7 +50,7 @@ fi
update_app_number=`echo ${updatetext%package*} #从右向左截取第一个 src 后的字符串` 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 sudo echo "$update_app_number" > /tmp/spark-store-updatenum/number