From 2f0ca615e49a34907ac4864908581aaa7a1b9558 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 14 Jun 2017 15:34:11 +0200 Subject: bin/common-functions: really delete old package meta data --- bin/common-functions | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'bin/common-functions') diff --git a/bin/common-functions b/bin/common-functions index 00da63c..d954a36 100755 --- a/bin/common-functions +++ b/bin/common-functions @@ -242,13 +242,27 @@ generate_package_metadata() { # delete old (=unneeded) meta data of packages delete_old_metadata() { - true -# ls -1 "${file_prefix%.*.*}."* 2> /dev/null | \ -# sed 's|^.*/||' | \ -# grep "^${package//./\\.}"'\.\([0-9a-f]\{40\}\.\)\{2\}\(builds\|depends\|needs\|packages\|SRCINFO\)$' | \ -# while read file; do -# rm "${work_dir}/package-infos/${file}" -# done + + ( + ls -1 "${work_dir}/package-infos" | \ + sed ' + s|\.\([^.]\+\)\.\([^.]\+\)\.[^.]\+$| \1 \2| + ' | \ + sort -u + ls -1 "${work_dir}/package-states" | \ + sed ' + s|\.\([^.]\+\)\.\([^.]\+\)\(\.[^.]\+\)\{2\}$| \1 \2| + ' | \ + sort -u | \ + sed 'p' + cut -d' ' -f1,2,3 "${work_dir}/build-list" | \ + sed 'p' + ) | \ + sort | \ + uniq -u | \ + while read -r pkg rev mod_rev; do + rm -f "${work_dir}/package-infos/${pkg}.${rev}.${mod_rev}".* + done } # official_or_community $package.$repo_revision.$mod_repo_revision.$repository -- cgit v1.2.3-70-g09d2