summaryrefslogtreecommitdiff
path: root/make_individual_torrent
diff options
context:
space:
mode:
authorJoseph Graham <joseph@fibreglass.tunachunks>2014-07-27 11:55:08 +0100
committerJoseph Graham <joseph@fibreglass.tunachunks>2014-07-27 11:55:08 +0100
commitdb2ea03e53a3aed1c8350811be70a31c7ea0ef53 (patch)
tree258f1ee22497e8b0bd7bf775583c7c9f5a0c117a /make_individual_torrent
parentb2a763cee1f67751065c39800a59c431ec872bfa (diff)
Added new file
Diffstat (limited to 'make_individual_torrent')
-rw-r--r--make_individual_torrent44
1 files changed, 44 insertions, 0 deletions
diff --git a/make_individual_torrent b/make_individual_torrent
new file mode 100644
index 0000000..0cfee56
--- /dev/null
+++ b/make_individual_torrent
@@ -0,0 +1,44 @@
+#! /bin/bash
+# Copyright (C) 2014 Joseph Graham <joseph@t67.eu>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This script is called by `make_repo_torrents' to make a torrent. It
+# depends on `mktorrent'. It takes the following arg:
+# $1 - path of package
+
+# Comma seperated list of trackers, no spaces
+# t67.eu is run by Xylon, hackcoop by fauno & friends
+trackers='http://t67.eu:6969/announce,http://tracker.hackcoop.com.ar/announce'
+
+# This mirror is put as a webseed. Which mirror we use for a webseed
+# doesn't really matter since it's re-written on the client machine by
+# pacman2pacman so it won't normally be used anyway.
+seed_url='http://repo.parabolagnulinux.org/'
+
+if [[ -z "${1}" ]]
+then
+ echo "Error. First arg must be the path of the package."
+ echo 1
+fi
+
+pkg="${1}"
+
+pkg_name="${pkg##*/}"
+
+# URL of the actual package for the webseed
+webseed="${seed_url}${pkg#${public_location}}"
+
+mktorrent -a "${trackers}" "${pkg}" -w "${webseed}" >/dev/null ||
+echo "Error making torrent for \"${pkg}\""