From 536e5073ae45d141664570b5d5cb0963a2c1903d Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 4 Jul 2017 09:28:00 +0200 Subject: bin/cleanup: remove old locked and broken markers --- bin/cleanup | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'bin/cleanup') 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 ( -- cgit v1.2.3-70-g09d2