diff options
author | Joseph Graham <joseph.graham@gmx.com> | 2017-05-18 16:11:41 +0100 |
---|---|---|
committer | Joseph Graham <joseph.graham@gmx.com> | 2017-05-18 16:11:41 +0100 |
commit | 64727f9a11fd57df4f557ac2b074a898a94c7c10 (patch) | |
tree | 0e9239fe48aa60a35a6a69bb8a2b3e33f2fbe8bc /pacman2pacman-get | |
parent | dc2e4db5bdef8df736469aae8ee0523b860d810b (diff) |
Fixed webseed-changing and improved recovery from broken torrents.
Diffstat (limited to 'pacman2pacman-get')
-rw-r--r-- | pacman2pacman-get | 11 |
1 files 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}" |