summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-06-20 10:59:53 +0200
committerErich Eckner <git@eckner.net>2017-06-20 10:59:53 +0200
commit303e44cf2a88867fffd8e6599ff3f5632a6ca4b1 (patch)
tree56e52b89a043c43d66615db36a08fc88fcac2206
parent8a04bad07d3e95a46f061707e0802c81c9d7a410 (diff)
downloadbuilder-303e44cf2a88867fffd8e6599ff3f5632a6ca4b1.tar.xz
bin/db-update: remove old state files
-rwxr-xr-xbin/db-update5
1 files changed, 5 insertions, 0 deletions
diff --git a/bin/db-update b/bin/db-update
index 45a5a61..3aced15 100755
--- a/bin/db-update
+++ b/bin/db-update
@@ -149,6 +149,11 @@ move_package() {
rm \
"${work_dir}/package-states/${package}.${from_ending}"
else
+ # remove old state files of $package with ending $to_ending
+ ls "${work_dir}/package-states" | \
+ grep "^$(str_to_regex "${package}")\(\.[^.]\+\)\{3\}\.${to_ending}\$" | \
+ sed "s|^|${work_dir}/package-states/|" | \
+ xargs -rn1 rm
mv \
"${work_dir}/package-states/${package}.${from_ending}" \
"${work_dir}/package-states/${package}.${to_ending}"