mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-13 12:22:05 +08:00
!59 * 调整 现在与系统更新分开,不再导致更新失败 * 支持直接更新软件源文件,不再让d.吃全部更新流量 * ss-apt-fast不再强制root权限
* !61 $1为policy时,apt-fast换成apt * 手动更新时也重新获取源文件 * 修改: tool/ss-apt-fast * * 调整 现在与系统更新分开,不再导致更新失败
This commit is contained in:
11
debian/changelog
vendored
11
debian/changelog
vendored
@@ -1,3 +1,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
spark-store (3.1.3-2) stable; urgency=medium
|
||||||
|
|
||||||
|
* 调整 现在与系统更新分开,不再导致更新失败
|
||||||
|
* 支持直接更新软件源文件,不再让d.吃全部更新流量
|
||||||
|
* ss-apt-fast不再强制root权限
|
||||||
|
|
||||||
|
|
||||||
|
-- shenmo <shenmo@spark-app.store> Fri, 30 Jan 2022 00:00:00 +0800
|
||||||
|
|
||||||
spark-store (3.1.3-1) stable; urgency=medium
|
spark-store (3.1.3-1) stable; urgency=medium
|
||||||
|
|
||||||
* 修复 下载提前退出
|
* 修复 下载提前退出
|
||||||
|
|||||||
15
debian/spark-store.postinst
vendored
15
debian/spark-store.postinst
vendored
@@ -20,8 +20,19 @@ case "$1" in
|
|||||||
gpg --dearmor /tmp/spark-store-install/spark-store.asc
|
gpg --dearmor /tmp/spark-store-install/spark-store.asc
|
||||||
cp -f /tmp/spark-store-install/spark-store.asc.gpg /etc/apt/trusted.gpg.d/spark-store.gpg
|
cp -f /tmp/spark-store-install/spark-store.asc.gpg /etc/apt/trusted.gpg.d/spark-store.gpg
|
||||||
|
|
||||||
|
|
||||||
|
# Remove existing source file
|
||||||
|
rm -f /etc/apt/preferences.d/sparkstore
|
||||||
|
rm -f /etc/apt/sources.list.d/sparkstore.list
|
||||||
|
|
||||||
|
|
||||||
# Run apt update to avoid users being fucked up by the non-exist dependency problem
|
# Run apt update to avoid users being fucked up by the non-exist dependency problem
|
||||||
apt update -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
|
|
||||||
|
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"
|
||||||
|
# 下载源列表
|
||||||
|
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"
|
||||||
|
# 更新
|
||||||
|
|
||||||
|
|
||||||
# Create symbo links to start upgrade detect
|
# Create symbo links to start upgrade detect
|
||||||
ln -s /opt/durapps/spark-store/bin/update-upgrade/autostart/spark-update-notifier.desktop /etc/xdg/autostart/spark-update-notifier.desktop
|
ln -s /opt/durapps/spark-store/bin/update-upgrade/autostart/spark-update-notifier.desktop /etc/xdg/autostart/spark-update-notifier.desktop
|
||||||
@@ -42,6 +53,8 @@ case "$1" in
|
|||||||
|
|
||||||
# Remove temp dir
|
# Remove temp dir
|
||||||
rm -rf /tmp/spark-store-install
|
rm -rf /tmp/spark-store-install
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
triggered)
|
triggered)
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
Package: *
|
|
||||||
Pin: origin *.deepinos.org.cn
|
|
||||||
Pin-Priority: 400
|
|
||||||
1
tool/apt-fast-conf/sources.list.d/sparkstore.list
Normal file
1
tool/apt-fast-conf/sources.list.d/sparkstore.list
Normal file
@@ -0,0 +1 @@
|
|||||||
|
deb [by-hash=force] https://d.store.deepinos.org.cn /
|
||||||
@@ -1,19 +1,33 @@
|
|||||||
#/bin/bash
|
#/bin/bash
|
||||||
|
|
||||||
if [ "$(id -u)" != "0" ]
|
|
||||||
then
|
|
||||||
echo "ss-apt-fast需要在root下运行"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
DEPEND=`which apt-fast`
|
DEPEND=`which apt-fast`
|
||||||
if [ "$DEPEND" = "" ] ; then
|
if [ "$DEPEND" = "" ] ; then
|
||||||
echo "未安装依赖:apt-fast 开始安装"
|
echo "未安装依赖:apt-fast 开始安装"
|
||||||
apt install apt-fast -y
|
sudo apt install apt-fast -y
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm /opt/durapps/spark-store/bin/apt-fast-conf/apt-fast.conf
|
mkdir -p /tmp/ss-apt-fast-conf/sources.list.d
|
||||||
|
# 创建文件夹
|
||||||
echo "从服务器获取配置和镜像列表..."
|
echo "从服务器获取配置和镜像列表..."
|
||||||
curl -s --progress-bar -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"
|
echo "Getting server and mirror lists..."
|
||||||
|
echo
|
||||||
|
|
||||||
bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/apt-fast.conf' /etc/apt-fast.conf apt-fast "$@"
|
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
|
||||||
|
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
|
||||||
|
|||||||
@@ -46,8 +46,7 @@ isuos=`cat /etc/os-release | grep UnionTech`
|
|||||||
##############判断是否是root运行,如果是,则正常走;如果不是,则代输密码
|
##############判断是否是root运行,如果是,则正常走;如果不是,则代输密码
|
||||||
if [ "$(id -u)" != "0" ];then
|
if [ "$(id -u)" != "0" ];then
|
||||||
#############################无root权限时
|
#############################无root权限时
|
||||||
#临时提升星火源的优先级
|
|
||||||
echo "$upass" | sudo -S sed -i 's/400/500/g' /etc/apt/preferences.d/sparkstore
|
|
||||||
|
|
||||||
IS_INSTALLED=`which apt-fast`
|
IS_INSTALLED=`which apt-fast`
|
||||||
if [ "$IS_INSTALLED" = "" ] ; then
|
if [ "$IS_INSTALLED" = "" ] ; then
|
||||||
@@ -69,16 +68,14 @@ 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 install -yf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$upass" | sudo -S sed -i 's/500/400/g' /etc/apt/preferences.d/sparkstore
|
|
||||||
#恢复优先级
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
else
|
else
|
||||||
###########################有root权限时
|
###########################有root权限时
|
||||||
|
|
||||||
#临时提升星火源的优先级
|
|
||||||
sed -i 's/400/500/g' /etc/apt/preferences.d/sparkstore
|
|
||||||
|
|
||||||
IS_INSTALLED=`which apt-fast`
|
IS_INSTALLED=`which apt-fast`
|
||||||
if [ "$IS_INSTALLED" = "" ] ; then
|
if [ "$IS_INSTALLED" = "" ] ; then
|
||||||
@@ -99,8 +96,6 @@ echo ---------------------------------------------------------------------------
|
|||||||
dpkg -i $1 || ss-apt-fast install -yf
|
dpkg -i $1 || ss-apt-fast install -yf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sed -i 's/500/400/g' /etc/apt/preferences.d/sparkstore
|
|
||||||
#恢复优先级
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,12 @@
|
|||||||
echo "以上可升级,是否升级?[y/n]"
|
echo "以上可升级,是否升级?[y/n]"
|
||||||
read yes_or_no
|
read yes_or_no
|
||||||
if [ "$yes_or_no" = "y" ];then
|
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"
|
mkdir -p /tmp/ss-apt-fast-conf/sources.list.d
|
||||||
|
|
||||||
|
|
||||||
|
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 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
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
@@ -73,6 +73,7 @@ case $option in
|
|||||||
2)
|
2)
|
||||||
echo "请注意:如果有些更新需要从系统获取更多依赖,你将需要手动操作 sudo ss-apt-fast upgrade"
|
echo "请注意:如果有些更新需要从系统获取更多依赖,你将需要手动操作 sudo ss-apt-fast upgrade"
|
||||||
echo "执行以下操作需要授权..."
|
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"
|
||||||
/opt/durapps/spark-store/bin/update-upgrade/ss-upgrade-list.sh
|
/opt/durapps/spark-store/bin/update-upgrade/ss-upgrade-list.sh
|
||||||
/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade.sh
|
/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade.sh
|
||||||
echo "---请按回车返回"
|
echo "---请按回车返回"
|
||||||
|
|||||||
@@ -36,8 +36,11 @@ fi
|
|||||||
|
|
||||||
#The code above is modified from https://blog.csdn.net/yaxuan88521/article/details/120516298
|
#The code above is modified from https://blog.csdn.net/yaxuan88521/article/details/120516298
|
||||||
|
|
||||||
|
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=`sudo apt update -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"`
|
|
||||||
|
|
||||||
mkdir -p /tmp/spark-store-updatenum/
|
mkdir -p /tmp/spark-store-updatenum/
|
||||||
|
|
||||||
|
|||||||
@@ -3,4 +3,4 @@ set -e
|
|||||||
|
|
||||||
|
|
||||||
echo "---可更新的应用有:"
|
echo "---可更新的应用有:"
|
||||||
sudo apt list --upgradable -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
|
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 list --upgradable -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
|
||||||
|
|||||||
Reference in New Issue
Block a user