summaryrefslogtreecommitdiff
path: root/bin/cleanup
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-06-22 09:38:52 +0200
committerErich Eckner <git@eckner.net>2017-06-22 09:38:52 +0200
commita081bc5508be7039eac7e13738814df1e4821e3f (patch)
tree81257552a0eb4fe10d2f9ee7a08eba73c147cab6 /bin/cleanup
parent89854fa2a5367640535935926caf48d1f1c8d5a1 (diff)
downloadbuilder-a081bc5508be7039eac7e13738814df1e4821e3f.tar.xz
bin/cleanup new
Diffstat (limited to 'bin/cleanup')
-rwxr-xr-xbin/cleanup27
1 files changed, 27 insertions, 0 deletions
diff --git a/bin/cleanup b/bin/cleanup
new file mode 100755
index 0000000..e31dbb3
--- /dev/null
+++ b/bin/cleanup
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+# clean up unnecessary data
+
+. "${0%/*}/../conf/default.conf"
+
+if ! "${base_dir}/bin/sanity-check" -r; then
+ >&2 echo 'Build master is not sane.'
+ exit 1
+fi
+
+(
+ ls '/srv/http/build-logs' | \
+ sed 's|\.[^.]\+\.build-log\.gz$||' | \
+ sort -u
+ ls "${work_dir}/package-states" | \
+ grep '\.broken$\|\.locked$' | \
+ sed '
+ s|\.[^.]\+$||
+ p
+ '
+) | \
+ sort | \
+ uniq -u | \
+ while read -r s t; do
+ rm -f "/srv/http/build-logs/${s}."*
+ done