Merge latest mktorrent from current config

Add support for HTTP seeds in torrents.
Closes: #729222. Inspired by a patch from Paul Wise.
This commit is contained in:
Steve McIntyre 2013-11-26 01:50:52 +00:00
parent 08c66eaf07
commit 96563554ee
1 changed files with 10 additions and 1 deletions

View File

@ -1,14 +1,23 @@
#!/bin/sh #!/bin/sh
HTTPBASE="http://cdimage.debian.org/cdimage"
for FILE in $@; do for FILE in $@; do
MKTORRENT=/home/debian-cd/bt/btmakemetafile.py MKTORRENT=btmakemetafile.bittornado
ISODIR=`dirname $FILE` ISODIR=`dirname $FILE`
BTDIR=`echo $ISODIR | sed 's/iso-/bt-/;s/usb-/bt-/'` BTDIR=`echo $ISODIR | sed 's/iso-/bt-/;s/usb-/bt-/'`
if [ ! -d $BTDIR ] ; then if [ ! -d $BTDIR ] ; then
mkdir -p $BTDIR mkdir -p $BTDIR
fi fi
# Add 2 http seeds: the release path *and* the archive path -
# hopefully clients will use whichever is available!
VER=$(echo ${FILE} | sed 's,^.*/debian-,,;s,-.*$,,')
HTTP1="${HTTPBASE}/release/${VER}/${FILE}"
HTTP2="${HTTPBASE}/archive/${VER}/${FILE}"
$MKTORRENT http://bttracker.debian.org:6969/announce \ $MKTORRENT http://bttracker.debian.org:6969/announce \
--comment '"Debian CD from cdimage.debian.org"' \ --comment '"Debian CD from cdimage.debian.org"' \
--httpseeds ${HTTP1}\|${HTTP2} \
$FILE | grep -v complete $FILE | grep -v complete
mv $FILE.torrent $BTDIR mv $FILE.torrent $BTDIR
done done