summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pacman2pacman-get11
1 files changed, 11 insertions, 0 deletions
diff --git a/pacman2pacman-get b/pacman2pacman-get
index 99cf6e9..c1e93d1 100644
--- a/pacman2pacman-get
+++ b/pacman2pacman-get
@@ -96,6 +96,17 @@ fi
if [[ "${response}" == 'found_torrent' ]]
then
cd "${pkg_cache_location}"
+
+ # Re-write the webseeds in the torrent to make it use the user's
+ # own mirror. We can just use the ${url} var.
+
+ # 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"
+
+ mv "${torrent_folder}/${url##*/}.torrent.modified" "${torrent_folder}/${url##*/}.torrent"
+
# Add the torrent to transmission
transmission-remote -a "${torrent_folder}/${url##*/}.torrent" -w "${pkg_cache_location}" &>/dev/null