summaryrefslogtreecommitdiff
path: root/cron-jobs/make_repo_torrents
diff options
context:
space:
mode:
Diffstat (limited to 'cron-jobs/make_repo_torrents')
-rwxr-xr-xcron-jobs/make_repo_torrents12
1 files changed, 10 insertions, 2 deletions
diff --git a/cron-jobs/make_repo_torrents b/cron-jobs/make_repo_torrents
index dd14b22..68cc942 100755
--- a/cron-jobs/make_repo_torrents
+++ b/cron-jobs/make_repo_torrents
@@ -22,11 +22,19 @@
# so it's OK to just stuff all the torrents into a single directory.
set -eE
-script_directory="$(dirname "$(readlink -e "$0")")/.."
. "$(dirname "$(readlink -e "$0")")/../config"
. "$(dirname "$(readlink -e "$0")")/../torrent.conf"
. "$(dirname "$(readlink -e "$0")")/../db-functions"
+make_individual_torrent() {
+ local pkgfile=$1
+ local IFS=,
+ mktorrent \
+ -a "${TRACKERS[*]}" \
+ -w "${WEBSEED_MIRROR}${pkgfile#"${FTP_BASE}/"}" \
+ -- "${pkgfile}" >/dev/null
+}
+
mkdir -p -- "${FTP_BASE}/${TORRENTPOOL}"
cd "${FTP_BASE}/${TORRENTPOOL}"
@@ -39,7 +47,7 @@ for pkgpath in "$FTP_BASE"/*/os/*/*${PKGEXTS}; do
# If a .torrent file does not already exist for this package, we call
# `make_individual_torrent' to make it.
if ! [[ -f ${pkgfile}.torrent ]]; then
- "$script_directory/make_individual_torrent" "$pkgpath"
+ make_individual_torrent "$pkgpath"
fi
done