From 36b05c43c31e04b3e6ee078643366133ce81190a Mon Sep 17 00:00:00 2001 From: Joseph Graham Date: Thu, 22 Jun 2017 08:13:14 +0100 Subject: Cosmetic changes to how it handles stalled downloads. --- pacman2pacman-get | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'pacman2pacman-get') diff --git a/pacman2pacman-get b/pacman2pacman-get index d93bdd8..b94b14b 100644 --- a/pacman2pacman-get +++ b/pacman2pacman-get @@ -223,6 +223,7 @@ then # If our percent hasn't changed after the defined time we fall back to HTTP. if (( timenow > ( starttime + webseed_check_freq ) )) && [[ "${progress}" == "${last_check_percentage}" ]] then + echo # the previous print was not followed by a newline echo $"Download stalled. Removing torrent from transmission and falling back to HTTP." transmission-remote -t "${id}" -r > /dev/null gotourbaby=0 @@ -328,21 +329,22 @@ then if ! new_mod_time=$(stat -c %Y "/srv/pacman2pacman/dbcache/${filename##*/}" 2>/dev/null) then progress='failed' + printf "\r${http_download_string}" "${pname}" "${progress}" # If the file was not modified we display such elif [[ "${new_mod_time}" == "${mod_time}" ]] then progress='file not modified' + printf "\r${http_download_string}" "${pname}" "${progress}" fi else # It's not a dbfile. Just check the output file exists. if ! [[ -f "${filename}" ]] then progress='failed' + printf "\r${http_download_string}" "${pname}" "${progress}" fi fi - - printf "\r${http_download_string}" "${pname}" "${progress}" echo -- cgit v1.2.2