diff options
Diffstat (limited to 'pacman2pacman-get')
-rw-r--r-- | pacman2pacman-get | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/pacman2pacman-get b/pacman2pacman-get index 7dde661..2b49adf 100644 --- a/pacman2pacman-get +++ b/pacman2pacman-get @@ -1,6 +1,8 @@ #! /bin/bash # /usr/bin/pacman2pacman-get # +# Version 1.1 +# # Copyright (C) 2014 Joseph Graham <joseph@t67.eu> # # This program is free software: you can redistribute it and/or modify @@ -20,6 +22,8 @@ # Where Pacman2pacman will look to find .torrent files. torrents='http://repo.parabolagnulinux.org/torrents/' +pkg_cache_location='/var/cache/pacman/pkg' + # Pacman2pacman should be called like this from /etc/pacman.conf: # XferCommand = /usr/bin/pacman2pacman-get %u %o @@ -40,7 +44,7 @@ fi torrent_url="${torrents}${url##*/}.torrent" -cd /srv/pacman2pacman/torrents +cd "${pkg_cache_location}" # Find the name of the package that will be displayed pname="${url##*/}" @@ -50,7 +54,7 @@ pname="${pname%%-[[:digit:]]*}" if curl -O -f -L -s -A 'Pacman2pacman' "${torrent_url}" then # Add the torrent to transmission - transmission-remote -a "${url##*/}.torrent" -w /srv/pacman2pacman/downloads &>/dev/null + transmission-remote -a "${url##*/}.torrent" -w "${pkg_cache_location}" &>/dev/null # The torrent is now downloading. To get info about the torrent in # order to display a progress bar we need to know it's id. @@ -99,7 +103,7 @@ then echo - ln "/srv/pacman2pacman/downloads/${url##*/}" "${filename}" || exit 1 + ln -f "${pkg_cache_location}/${url##*/}" "${filename}" || exit 1 else # There's no .torrent so we download it by just HTTP. |