mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-07-10 23:55:58 +08:00
feat: 提升aptss稳定性
This commit is contained in:
parent
267eae076e
commit
b292c6cbf2
1
debian/changelog
vendored
1
debian/changelog
vendored
@ -1,6 +1,7 @@
|
|||||||
spark-store (4.3.1) UNRELEASED; urgency=medium
|
spark-store (4.3.1) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
* 修复自提权更新问题
|
* 修复自提权更新问题
|
||||||
|
* 提升aptss稳定性
|
||||||
|
|
||||||
-- shenmo <shenmo@spark-app.store> Tue, 24 Sep 2024 11:27:08 +0800
|
-- 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
|
eval "${_DOWNLOADER}" # execute downloadhelper command
|
||||||
if [ "$(find "$DLDIR" -printf . | wc -c)" -gt 1 ]; then
|
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
|
# Move all packages to the apt install directory by force to ensure
|
||||||
# already existing debs which may be incomplete are replaced
|
# 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
|
fi
|
||||||
cd - &>/dev/null || msg "Failed to change back directory" "warning"
|
cd - &>/dev/null || msg "Failed to change back directory" "warning"
|
||||||
fi
|
fi
|
||||||
|
21
tool/aptss
21
tool/aptss
@ -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="$?"
|
ret="$?"
|
||||||
if [ "$ret" -ne 0 ];then
|
if [ "$ret" -ne 0 ];then
|
||||||
echo -e "\e[1;33m$TRANSHELL_CONTENT_PLEASE_USE_APTSS_INSTEAD_OF_APT\e[0m"
|
echo -e "\e[1;33m$TRANSHELL_CONTENT_PLEASE_USE_APTSS_INSTEAD_OF_APT\e[0m"
|
||||||
@ -86,19 +86,7 @@ exit $ret
|
|||||||
fi
|
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
|
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
|
elif [ "$1" = "update" ];then
|
||||||
|
|
||||||
echo -e "\e[1;32m${TRANSHELL_CONTENT_GETTING_SERVER_CONFIG_AND_MIRROR_LIST}\e[0m"
|
echo -e "\e[1;32m${TRANSHELL_CONTENT_GETTING_SERVER_CONFIG_AND_MIRROR_LIST}\e[0m"
|
||||||
echo
|
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"
|
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"
|
curl --progress-bar -o /tmp/aptss-conf/apt-fast.conf "${SPARK_DOWNLOAD_SERVER_URL}/apt-fast.conf"
|
||||||
chmod -R 755 /tmp/aptss-conf
|
chmod -R 755 /tmp/aptss-conf
|
||||||
### 额外一份拿来给aptss自动补全用
|
### 额外一份拿来给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
|
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
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user