summaryrefslogtreecommitdiff
path: root/bin/cleanup
diff options
context:
space:
mode:
Diffstat (limited to 'bin/cleanup')
-rwxr-xr-xbin/cleanup46
1 files changed, 23 insertions, 23 deletions
diff --git a/bin/cleanup b/bin/cleanup
index 64f0689..206b84c 100755
--- a/bin/cleanup
+++ b/bin/cleanup
@@ -19,29 +19,6 @@ if [ -s "${work_dir}/build-master-sanity" ]; then
exit
fi
-# remove logs where package is not broken/locked anymore
-
-{
- find "${build_log_directory}/error" -maxdepth 1 -type f -printf 'file %f\n'
- # shellcheck disable=SC2016
- {
- printf 'SELECT "mysql",`failed_builds`.`log_file`'
- printf ' FROM `failed_builds`;\n'
- } | \
- mysql_run_query | \
- tr '\t' ' '
-} | \
- sort -k2,2 -k1,1 | \
- uniq -uf 1 | \
- sed -n '
- s/^file //
- T
- p
- ' | \
- while read -r file; do
- rm "${build_log_directory}/error/${file}"
- done
-
# only keep 10 newest logs per failed package and fail_reason
# shellcheck disable=SC2016
@@ -79,6 +56,29 @@ fi
' | \
mysql_run_query
+# remove logs where package is not broken/locked anymore
+
+{
+ find "${build_log_directory}/error" -maxdepth 1 -type f -printf 'file %f\n'
+ # shellcheck disable=SC2016
+ {
+ printf 'SELECT "mysql",`failed_builds`.`log_file`'
+ printf ' FROM `failed_builds`;\n'
+ } | \
+ mysql_run_query | \
+ tr '\t' ' '
+} | \
+ sort -k2,2 -k1,1 | \
+ uniq -uf 1 | \
+ sed -n '
+ s/^file //
+ T
+ p
+ ' | \
+ while read -r file; do
+ rm "${build_log_directory}/error/${file}"
+ done
+
# 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' '{}' \; \