summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@parabola.nu>2018-09-25 20:46:56 -0400
committerLuke Shumaker <lukeshu@parabola.nu>2018-09-25 20:48:37 -0400
commit02bba05a6a170a5534c933f7a25f3f1ea488545a (patch)
tree0a23e093da4b19818eb8b284e85b035c0c5a8e21
parent24734b787b417e85f17dca9eabaa6a419765b85a (diff)
make_repo_torrents: Don't abort on symlink errors $TORRENTPOOLparabola/20180925.1
These should be errors, but they shouldn't prevent the creation of torrent files in other directories. https://labs.parabola.nu/issues/1253
-rwxr-xr-xcron-jobs/make_repo_torrents7
1 files changed, 5 insertions, 2 deletions
diff --git a/cron-jobs/make_repo_torrents b/cron-jobs/make_repo_torrents
index 5182b8f..d8613a4 100755
--- a/cron-jobs/make_repo_torrents
+++ b/cron-jobs/make_repo_torrents
@@ -31,6 +31,8 @@ mkdir -p -- "${FTP_BASE}/${TORRENTPOOL}"
IFS=, # for ${TRACKERS[*]} and ${WEBSEEDS[*]}
+ret=0
+
make_torrent() {
local pkgfile="$1"
local target
@@ -51,7 +53,7 @@ make_torrent() {
if [[ -f "${FTP_BASE}/${TORRENTPOOL}/${pkgfile##*/}.torrent" &&
! -L "${FTP_BASE}/${TORRENTPOOL}/${pkgfile##*/}.torrent" ]]; then
ln -T -- "${FTP_BASE}/${TORRENTPOOL}/${pkgfile##*/}.torrent" "${pkgfile}.torrent"
- ln -sfrT -- "${pkgfile}.torrent" "${FTP_BASE}/${TORRENTPOOL}/${pkgfile##*/}.torrent"
+ ln -sfrT -- "${pkgfile}.torrent" "${FTP_BASE}/${TORRENTPOOL}/${pkgfile##*/}.torrent" || ret=$?
else
msg2 'Creating %s' "${pkgfile}.torrent"
mktorrent \
@@ -59,7 +61,7 @@ make_torrent() {
--web-seed="${WEBSEEDS[*]/%/"${pkgfile#"${FTP_BASE}"}"}" \
--output="${pkgfile}.torrent" \
-- "${pkgfile}" >/dev/null
- ln -sfrT -- "${pkgfile}.torrent" "${FTP_BASE}/${TORRENTPOOL}/${pkgfile##*/}.torrent"
+ ln -sfrT -- "${pkgfile}.torrent" "${FTP_BASE}/${TORRENTPOOL}/${pkgfile##*/}.torrent" || ret=$?
fi
fi
}
@@ -69,3 +71,4 @@ for pkgfile in "$FTP_BASE"/*/os/*/*${PKGEXTS}; do
make_torrent "$pkgfile"
done
msg 'Done'
+exit $ret