From 64727f9a11fd57df4f557ac2b074a898a94c7c10 Mon Sep 17 00:00:00 2001 From: Joseph Graham Date: Thu, 18 May 2017 16:11:41 +0100 Subject: Fixed webseed-changing and improved recovery from broken torrents. --- pacman2pacman-get | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pacman2pacman-get b/pacman2pacman-get index 46d3319..dd18bb9 100644 --- a/pacman2pacman-get +++ b/pacman2pacman-get @@ -129,12 +129,19 @@ then # We need to find out the length of the ${url} var. len="${#url}" - sed "s#url-listl[[:digit:]]\+.\+.pkg.tar.xz#url-listl${len}:${url}#" < "${torrent_folder}/${url##*/}.torrent" > "${torrent_folder}/${url##*/}.torrent.modified" + sed "s#url-list[[:digit:]]\+.\+.pkg.tar.xz#url-list${len}:${url}#" < "${torrent_folder}/${url##*/}.torrent" > "${torrent_folder}/${url##*/}.torrent.modified" mv "${torrent_folder}/${url##*/}.torrent.modified" "${torrent_folder}/${url##*/}.torrent" transmission_output=$(mktemp) - + + # If the torrent is already in transmission we remove it because + # we want it to be fresh (with current webseed list etc) + if id=$(transmission-remote -l | grep "${url##*/}") + then + transmission-remote -t "${id}" -r + fi + # Add the torrent to transmission (( debugmode )) && transmission-remote -a "${torrent_folder}/${url##*/}.torrent" -w "${pkg_cache_location}" 2>&1 | tee "${transmission_output}" (( debugmode )) || transmission-remote -a "${torrent_folder}/${url##*/}.torrent" -w "${pkg_cache_location}" 2>&1 > "${transmission_output}" -- cgit v1.2.2