summaryrefslogtreecommitdiff
path: root/bin/cleanup
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-07-04 09:28:00 +0200
committerErich Eckner <git@eckner.net>2017-07-04 09:28:00 +0200
commit536e5073ae45d141664570b5d5cb0963a2c1903d (patch)
tree81d8578844beb3094ef95dde1f80a82355c24aa3 /bin/cleanup
parentd7606faf5a268e88c10a5e1b1b542fe8e77aeae4 (diff)
downloadbuilder-536e5073ae45d141664570b5d5cb0963a2c1903d.tar.xz
bin/cleanup: remove old locked and broken markers
Diffstat (limited to 'bin/cleanup')
-rwxr-xr-xbin/cleanup19
1 files changed, 19 insertions, 0 deletions
diff --git a/bin/cleanup b/bin/cleanup
index f84d687..f95a2a9 100755
--- a/bin/cleanup
+++ b/bin/cleanup
@@ -16,6 +16,25 @@ if ! "${base_dir}/bin/sanity-check" -r; then
exit 1
fi
+# remove broken/locked markes of packages not on the buildlist anymore
+
+(
+ ls "${work_dir}/package-states" | \
+ grep '\.broken$\|\.locked$' | \
+ sed '
+ s|^\(.*\)\.\([^.]\+\)\.\([^.]\+\)\.\([^.]\+\)\.[^.]\+$|state \0 \1 \2 \3 \4|
+ '
+ awk '{
+ print "order " $1 "." $2 "." $3 "." $4 " " $1 " " $2 " " $3 " " $4
+ }' "${work_dir}/build-list"
+) | \
+ sort -k3 | \
+ uniq -uf2 | \
+ grep '^state ' | \
+ awk '{print $2}' | \
+ sed "s|^|${work_dir}/package-states/|" | \
+ xargs -rn1 rm
+
# remove logs where package is not broken/locked anymore
(