summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Graham <joseph@fibreglass.tunachunks>2014-05-05 20:58:58 +0100
committerJoseph Graham <joseph@fibreglass.tunachunks>2014-05-05 20:58:58 +0100
commit80207a3dd755f2470e30bdb2c654211712c69af8 (patch)
treed24d829604d4b40a7e96f739262d3fc132fcee94
parent10b63588e09bb4d3862dadf85017884f3aee785c (diff)
Fixed it saving .torrent files in the wrong place
-rw-r--r--pacman2pacman-get10
1 files 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 <joseph@t67.eu>
#
@@ -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