From 84b99c0e495185eb423e9d8bc9418670b6ff9376 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 9 Mar 2018 11:44:02 +0100 Subject: bin/db-update: keep .testing, .tested, .done (mostly) in sync --- bin/db-update | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/bin/db-update b/bin/db-update index f87000a..adec0ef 100755 --- a/bin/db-update +++ b/bin/db-update @@ -9,10 +9,6 @@ # TODO: separate locks for staging, testing (and stable) -# TODO: sub_pkgrel=0 may or may not be omitted for the actual package :-/ - -# TODO: keep .testing, .tested, .done in sync - # shellcheck disable=SC2039 # shellcheck source=conf/default.conf . "${0%/*}/../conf/default.conf" @@ -274,4 +270,25 @@ for source_stability in 'testing' 'staging'; do printf ' SET `binary_packages`.`repository`=`moved_binary_packages`.`new_repository`;\n' } | \ mysql_run_query + + # TODO: this may delete too much, but these files will be obsolete soon anyway ... + find "${work_dir}/package-states/" \ + \( \ + -name '*.done' -o \ + -name '*.testing' -o \ + -name '*.tested' \ + \) \ + -exec grep -qxF "$(cut -d' ' -f1 < "${tmp_dir}/rm")" '{}' \; \ + -delete + find "${work_dir}/package-states/" \ + -name '*.tested' \ + -exec grep -qxF "$(cut -d' ' -f1 < "${tmp_dir}/mv")" '{}' \; \ + -delete + find "${work_dir}/package-states/" \ + -name '*.done' \ + -exec grep -qxF "$(cut -d' ' -f1 < "${tmp_dir}/mv")" '{}' \; \ + -prinft '%p\n' | \ + while read -r sf; do + mv "${sf}" "${sf%.done}.testing" + done done -- cgit v1.2.3