Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/cleanup11
1 files changed, 11 insertions, 0 deletions
diff --git a/bin/cleanup b/bin/cleanup
index 57c4e07..14d08ac 100755
--- a/bin/cleanup
+++ b/bin/cleanup
@@ -19,6 +19,14 @@ if [ -s "${work_dir}/build-master-sanity" ]; then
exit
fi
+# Lock the database - we should not run in parallel with db-update.
+exec 9> "${package_database_lock_file}"
+# shellcheck disable=SC2086
+if ! verbose_flock -n 9; then
+ >&2 echo 'come back (shortly) later - I cannot lock package database.'
+ exit 0
+fi
+
# only keep newest logs per failed package and fail_reason
# shellcheck disable=SC2016
@@ -68,6 +76,9 @@ fi
rm "${build_log_directory}/error/${file}"
done
+# Release database lock.
+flock -u 9 || true
+
# only keep namcap logs of last 2 weeks for succeeded packages
find "${build_log_directory}/success" -maxdepth 1 -type f -mtime +14 \
-not -exec zgrep -q '^+.*ELF file .* has text relocations' '{}' \; \