Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-06-14 15:34:11 +0200
committerErich Eckner <git@eckner.net>2017-06-14 15:34:11 +0200
commit2f0ca615e49a34907ac4864908581aaa7a1b9558 (patch)
treec30724449405cc1c004999b98a12f8f21fb4e63b /bin
parent87f80caab1c8d6f360d36860f209ee6cf8d84bfd (diff)
bin/common-functions: really delete old package meta data
Diffstat (limited to 'bin')
-rwxr-xr-xbin/common-functions28
1 files changed, 21 insertions, 7 deletions
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