diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-04-17 10:45:45 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-04-17 10:45:45 -0400 |
commit | a79d7c7251f4e6fd2f8b288b5c91a77a66ecff65 (patch) | |
tree | f44145d6cda8bb20070edf1ce464ad60b6bf3a04 /make_individual_torrent | |
parent | f73a4a8844641b780644b8b96865372dc34936bd (diff) | |
parent | 752bd700e9da464006bfbd9877cc858dfad545ba (diff) |
Merge branch 'lukeshu/xbs' into testmerge
# Conflicts:
# test/lib/common.inc
# test/test.d/create-filelists.sh
# test/test.d/db-move.sh
# test/test.d/db-remove.sh
# test/test.d/db-repo-add.sh
# test/test.d/db-repo-remove.sh
# test/test.d/db-update.sh
# test/test.d/ftpdir-cleanup.sh
# test/test.d/sourceballs.sh
Diffstat (limited to 'make_individual_torrent')
-rwxr-xr-x | make_individual_torrent | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/make_individual_torrent b/make_individual_torrent new file mode 100755 index 0000000..0a7e778 --- /dev/null +++ b/make_individual_torrent @@ -0,0 +1,52 @@ +#!/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 args: +# $1 - path of package +# $2 - public location + +# 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 + +if [[ -z "${2}" ]] +then + echo "Error. Second arg must be the public location." + echo 1 +fi + +pkg="${1}" +public_location="${2}" + +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}\"" |