2010-09-17 13:40:17 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2012-07-25 13:21:49 +02:00
|
|
|
/usr/sbin/env-update
|
|
|
|
. /etc/profile
|
|
|
|
|
|
|
|
# Path to molecules.git dir
|
|
|
|
SABAYON_MOLECULE_HOME="${SABAYON_MOLECULE_HOME:-/sabayon}"
|
|
|
|
export SABAYON_MOLECULE_HOME
|
2010-09-17 13:40:17 +02:00
|
|
|
|
|
|
|
announce_url="http://tracker.sabayon.org/tracker.php/announce"
|
2012-07-25 13:21:49 +02:00
|
|
|
iso_dir="${SABAYON_MOLECULE_HOME}/iso"
|
2010-09-17 13:40:17 +02:00
|
|
|
cd "${iso_dir}"
|
|
|
|
|
2011-12-30 11:18:50 +01:00
|
|
|
for iso_file in "${iso_dir}"/*.{iso,tar.gz,tar.xz}; do
|
2010-09-17 13:40:17 +02:00
|
|
|
iso_name="${iso_file/.iso}"
|
|
|
|
iso_name="${iso_name/.tar.gz}"
|
2011-12-30 11:18:50 +01:00
|
|
|
iso_name="${iso_name/.tar.xz}"
|
2011-10-26 15:34:42 +02:00
|
|
|
# do not make torrents for DAILY iso images
|
|
|
|
is_daily=$(echo ${iso_name} | grep DAILY)
|
|
|
|
if [ -n "${is_daily}" ]; then
|
|
|
|
continue
|
|
|
|
fi
|
2010-09-17 13:40:17 +02:00
|
|
|
torrent_file="${iso_file}.torrent"
|
|
|
|
[[ -f "${torrent_file}" ]] && rm "${torrent_file}"
|
|
|
|
iso_file_name="$(basename ${iso_file})"
|
2010-09-28 21:02:54 +02:00
|
|
|
echo "Cooking ${iso_file_name}"
|
2010-09-17 13:40:17 +02:00
|
|
|
mktorrent-borg -nd -a "${announce_url}" -n "${iso_name}" -o "${torrent_file}" "${iso_file_name}" || exit 1
|
|
|
|
done
|