index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2023-02-03 23:57:47 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2023-02-03 23:57:47 +0100 |
commit | 6828b5cff3f20875d51871ef91ffe0508fd5354e (patch) | |
tree | 3aa5151d24411653372aae1caae512662f0e68f2 | |
parent | 623c16779af136bfcd99305d9b558c94b3641d89 (diff) |
-rwxr-xr-x | bin/cleanup | 11 |
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' '{}' \; \ |