From d085f3de73421c5120a074a92392f570cb4c9f07 Mon Sep 17 00:00:00 2001 From: shenmo Date: Fri, 1 Sep 2023 22:56:44 +0800 Subject: [PATCH] fix: now wont inform aptss everytime --- tool/apt-fast/ss-apt-fast | 10 +++++++--- tool/aptss | 5 +++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/tool/apt-fast/ss-apt-fast b/tool/apt-fast/ss-apt-fast index 7dce20d..8b04b2a 100755 --- a/tool/apt-fast/ss-apt-fast +++ b/tool/apt-fast/ss-apt-fast @@ -1,5 +1,5 @@ #!/bin/bash -# +# # apt-fast v1.9 # Use this just like aptitude or apt-get for faster package downloading. # @@ -225,7 +225,9 @@ _create_lock() { eval "exec $LCK_FD>\"$LCK_FILE.lock\"" - trap "cleanup_aptfast; exit_cleanup_state" EXIT +# trap "cleanup_aptfast; exit_cleanup_state" EXIT +# This will hide the exit code + trap "cleanup_aptfast" EXIT trap "cleanup_aptfast; exit 1" INT TERM flock -n $LCK_FD || { msg_already_running; exit 1; } @@ -301,8 +303,10 @@ get_mirrors(){ # Globals to save package name, version, size and overall size. DOWNLOAD_DISPLAY= DOWNLOAD_SIZE=0 + # Get the package URLs. get_uris(){ + if [ ! -d "$(dirname "$DLLIST")" ] then if ! mkdir -p -- "$(dirname "$DLLIST")" @@ -449,6 +453,7 @@ display_downloadfile(){ } # Create and insert a PID number to lockfile. + _create_lock # Make sure aria2c (in general first parameter from _DOWNLOADER) is available. @@ -548,7 +553,6 @@ if [ "$option" == "install" ]; then REMOVE_WORKING_MESSAGE=y get_uris "$@" - [ -t 1 ] && [ -n "$REMOVE_WORKING_MESSAGE" ] && tput cuu 1 && tput el && tput cuu 1 # Test /tmp/apt-fast.list file exists and not just the apt-fast comment line. # Then download all files from the list. diff --git a/tool/aptss b/tool/aptss index f9c9805..fce5398 100755 --- a/tool/aptss +++ b/tool/aptss @@ -73,9 +73,10 @@ 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 - +ret="$?" +if [ "$ret" -ne 0 ];then echo -e "\e[1;33m$TRANSHELL_CONTENT_PLEASE_USE_APTSS_INSTEAD_OF_APT\e[0m" - +fi elif [ "$1" = "download" ];then