mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-13 20:32:05 +08:00
Enhance stability
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user