From 7c60b29f42ad4f2a1a8acd38c3688fd73b6de48e Mon Sep 17 00:00:00 2001 From: shenmo Date: Sun, 22 Mar 2026 17:57:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20aptss=20download=20?= =?UTF-8?q?=E4=BC=9A=E5=88=9B=E5=BB=BA=20tmp=20=E5=9E=83=E5=9C=BE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tool/apt-fast/ss-apt-fast | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tool/apt-fast/ss-apt-fast b/tool/apt-fast/ss-apt-fast index ec5de31..86731c6 100755 --- a/tool/apt-fast/ss-apt-fast +++ b/tool/apt-fast/ss-apt-fast @@ -120,8 +120,11 @@ _create_lock() # unlock and remove the lock file _remove_lock() { - flock -u "$LCK_FD" 2>/dev/null - rm -f "$LCK_FILE.lock" + # Only unlock if lock file exists (was created by _create_lock) + if [ -f "$LCK_FILE.lock" ]; then + flock -u "$LCK_FD" 2>/dev/null + rm -f "$LCK_FILE.lock" + fi } # Search for known options and decide if root privileges are needed. @@ -821,6 +824,9 @@ elif [ "$option" == "download" ]; then "${_APTMGR}" "$@" fi + # Clean up temporary directory for download command + cleanup_aptfast + elif [ "$option" == "source" ]; then msg msg "Working... this may take a while." "normal" @@ -847,6 +853,9 @@ elif [ "$option" == "source" ]; then # dpkg-source -x "$(basename "$srcfile")" #done < "$DLLIST" + # Clean up temporary directory for source command + cleanup_aptfast + # Execute package manager directly if unknown options are passed. else "${_APTMGR}" "${APT_SCRIPT_WARNING[@]}" "$@"