feat: 提升aptss稳定性

This commit is contained in:
shenmo 2024-10-13 22:37:52 +08:00
parent 267eae076e
commit b292c6cbf2
3 changed files with 17 additions and 16 deletions
debian
tool

1
debian/changelog vendored

@ -1,6 +1,7 @@
spark-store (4.3.1) UNRELEASED; urgency=medium
* 修复自提权更新问题
* 提升aptss稳定性
-- shenmo <shenmo@spark-app.store> Tue, 24 Sep 2024 11:27:08 +0800

@ -600,9 +600,18 @@ if [ "$option" == "install" ]; then
eval "${_DOWNLOADER}" # execute downloadhelper command
if [ "$(find "$DLDIR" -printf . | wc -c)" -gt 1 ]; then
# Delete incomplete/corrupted downloaded files, if any: Not recursive, as we don't expect any dirs to exist within $DLDIR.
# When Aria2c downloads a file and detects it is corrupted, its filename won't be renamed back to its actual name,
# preserving .aria2 file extension, which also indicates when a file hasn't been completely downloaded.
for x in *.aria2; do
rm -f "$x" "${x%.aria2}"
done
# Move all packages to the apt install directory by force to ensure
# already existing debs which may be incomplete are replaced
find . -type f -name "*.deb" -execdir mv -ft "$APTCACHE" {} \+
find . -type f \( -name '*.deb' -o -name '*.ddeb' \) -execdir mv -ft "$APTCACHE" {} \+
fi
cd - &>/dev/null || msg "Failed to change back directory" "warning"
fi

@ -78,7 +78,7 @@ if [ "$1" = "install" ] || [ "$1" = "upgrade" ] || [ "$1" = "full-upgrade" ] ||
###执行
${SS_APT_FAST} "$@" --allow-downgrades -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf
${SS_APT_FAST} "$@" --allow-downgrades -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf
ret="$?"
if [ "$ret" -ne 0 ];then
echo -e "\e[1;33m$TRANSHELL_CONTENT_PLEASE_USE_APTSS_INSTEAD_OF_APT\e[0m"
@ -86,19 +86,7 @@ exit $ret
fi
elif [ "$1" = "download" ];then
###执行
${SS_APT_FAST} "$@" --allow-downgrades -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf
elif [ "$1" = "policy" ] || [ "$1" = "search" ];then
###执行
/usr/bin/apt "$@" -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf
elif [ "$1" = "ssupdate" ];then
@ -116,6 +104,7 @@ curl --silent -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/spar
#只更新星火源
elif [ "$1" = "update" ];then
echo -e "\e[1;32m${TRANSHELL_CONTENT_GETTING_SERVER_CONFIG_AND_MIRROR_LIST}\e[0m"
echo
curl --progress-bar -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "${SPARK_DOWNLOAD_SERVER_URL}/sparkstore${STORE_LIST_URL}.list"
@ -123,8 +112,10 @@ mkdir -p /tmp/aptss-conf/
curl --progress-bar -o /tmp/aptss-conf/apt-fast.conf "${SPARK_DOWNLOAD_SERVER_URL}/apt-fast.conf"
chmod -R 755 /tmp/aptss-conf
### 额外一份拿来给aptss自动补全用
/usr/bin/apt "$@" -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf
${SS_APT_FAST} "$@" -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf
else
/usr/bin/apt "$@" -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf
${SS_APT_FAST} "$@" -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf
fi