From dcfb57f2a7fde1a93cfbb6aafc21fba2807b5bf9 Mon Sep 17 00:00:00 2001 From: shenmo Date: Sat, 6 Sep 2025 14:57:24 +0000 Subject: [PATCH] =?UTF-8?q?aptss=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shenmo --- debian/changelog | 2 +- tool/apt-fast/ss-apt-fast | 60 +++++++++++++++++++-------------------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9e6ddfe..0a3cdf3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -spark-store (4.8.1) UNRELEASED; urgency=medium +spark-store (4.8.1-1) UNRELEASED; urgency=medium * 修复了更新器安装完成后显示下载完成的bug diff --git a/tool/apt-fast/ss-apt-fast b/tool/apt-fast/ss-apt-fast index f1a0746..2832d5b 100755 --- a/tool/apt-fast/ss-apt-fast +++ b/tool/apt-fast/ss-apt-fast @@ -55,6 +55,36 @@ msg_already_running() # exit 1 #fi +# Move download file away so missing permissions won't stop usage. +CLEANUP_STATE=0 +cleanup_dllist() +{ + if [ -f "$DLLIST" ] + then + if ! mv -- "$DLLIST{,.old}" 2>/dev/null + then + if ! rm -fr -- "${LISTTEMP}" 2>/dev/null + then + msg "Could not clean up download list file." "warning" + msg "无法清除下载列表文件." "warning" + CLEANUP_STATE=1 + fi + fi + fi +} + +cleanup_aptfast() +{ + local last_exit_code=$? + [ "$CLEANUP_STATE" -eq 0 ] && CLEANUP_STATE=$last_exit_code + cleanup_dllist + _remove_lock +} + +exit_cleanup_state() +{ + exit $CLEANUP_STATE +} LCK_FD=99 # create the lock file and lock it, die on failure _create_lock() @@ -289,36 +319,6 @@ fi -# Move download file away so missing permissions won't stop usage. -CLEANUP_STATE=0 -cleanup_dllist() -{ - if [ -f "$DLLIST" ] - then - if ! mv -- "$DLLIST{,.old}" 2>/dev/null - then - if ! rm -fr -- "${LISTTEMP}" 2>/dev/null - then - msg "Could not clean up download list file." "warning" - msg "无法清除下载列表文件." "warning" - CLEANUP_STATE=1 - fi - fi - fi -} - -cleanup_aptfast() -{ - local last_exit_code=$? - [ "$CLEANUP_STATE" -eq 0 ] && CLEANUP_STATE=$last_exit_code - cleanup_dllist - _remove_lock -} - -exit_cleanup_state() -{ - exit $CLEANUP_STATE -} # decode url string # translates %xx but must not convert '+' in spaces