Merge remote-tracking branch 'refs/remotes/origin/master'

This commit is contained in:
2025-08-23 22:43:00 -05:00
3 changed files with 25 additions and 10 deletions

View File

@@ -1,18 +1,30 @@
#!/bin/sh
# vim: set sw=4 ts=4 sts=4 et :
QFILE="${HOME}"/createrepo.queue
REPOS_ROOT="${HOME}"/repos
wait_queue() {
inotifywait \
--event close_write \
--include "${QFILE##*/}" \
"${QFILE%/*}"
}
createrepo_loop() {
while sleep 30; do
[ -f "${QFILE}" ] || continue
mv "${QFILE}" "${QFILE}.work"
sort -u "${QFILE}.work" > "${QFILE}.sorted"
while read dir; do
printf 'Generating repository metadata for %s\n' "${dir}"
createrepo_c "${dir}"
done < "${QFILE}.sorted"
rm -f "${QFILE}.work" "${QFILE}.sorted"
while wait_queue; do
while [ -f "${QFILE}" ]; do
sleep 10
flock "${QFILE}" mv "${QFILE}" "${QFILE}.work"
sort -u "${QFILE}.work" > "${QFILE}.sorted"
while read dir; do
if [ -d "${dir}" ]; then
printf 'Generating repository metadata for %s\n' "${dir}"
createrepo_c "${dir}"
fi
done < "${QFILE}.sorted"
rm -f "${QFILE}.work" "${QFILE}.sorted"
done
done
}