From 80207a3dd755f2470e30bdb2c654211712c69af8 Mon Sep 17 00:00:00 2001 From: Joseph Graham Date: Mon, 5 May 2014 20:58:58 +0100 Subject: Fixed it saving .torrent files in the wrong place --- pacman2pacman-get | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pacman2pacman-get b/pacman2pacman-get index 81c0c5b..fd7ed37 100644 --- a/pacman2pacman-get +++ b/pacman2pacman-get @@ -1,7 +1,7 @@ #! /bin/bash # /usr/bin/pacman2pacman-get # -# Version 1.2 +# Version 1.2.1 # # Copyright (C) 2014 Joseph Graham # @@ -22,6 +22,8 @@ # Where Pacman2pacman will look to find .torrent files. torrents='http://repo.parabolagnulinux.org/torrents/' +torrent_folder='/srv/pacman2pacman/torrents' + pkg_cache_location='/var/cache/pacman/pkg' # Pacman2pacman should be called like this from /etc/pacman.conf: @@ -44,7 +46,7 @@ fi torrent_url="${torrents}${url##*/}.torrent" -cd "${pkg_cache_location}" +cd "${torrent_folder}" # Find the name of the package that will be displayed pname="${url##*/}" @@ -53,8 +55,9 @@ pname="${pname%%-[[:digit:]]*}" # Check for a .torrent. if curl -O -f -L -s -A 'Pacman2pacman' "${torrent_url}" then + cd "${pkg_cache_location}" # Add the torrent to transmission - transmission-remote -a "${url##*/}.torrent" -w "${pkg_cache_location}" &>/dev/null + transmission-remote -a "${torrent_folder}/${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. @@ -106,6 +109,7 @@ then mv -f "${pkg_cache_location}/${url##*/}" "${filename}" || exit 1 else + cd "${pkg_cache_location}" # There's no .torrent so we download it by just HTTP. # We must do some complicated stuff to customise the progress -- cgit v1.2.2