summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-10-31 13:27:42 +0100
committerErich Eckner <git@eckner.net>2017-10-31 13:27:42 +0100
commitf98c2aace96dc43da9a7523635b9916dc4e01516 (patch)
tree73a830453370ec91b94108d0c0c84e78f1d5ac4a /bin
parentd14a11c9b9f993305188b6b9972ddfd09557957c (diff)
downloadbuilder-f98c2aace96dc43da9a7523635b9916dc4e01516.tar.xz
bin/common-functions: delete_old_metadata: bugfix (and solve TODO)
Diffstat (limited to 'bin')
-rwxr-xr-xbin/common-functions6
-rwxr-xr-xbin/db-update2
2 files changed, 3 insertions, 5 deletions
diff --git a/bin/common-functions b/bin/common-functions
index 31880ef..1330bd1 100755
--- a/bin/common-functions
+++ b/bin/common-functions
@@ -234,7 +234,7 @@ delete_old_metadata() {
local current_metadata
current_metadata=$(
- find "${work_dir}/package-infos" -maxdepth 1 -printf '%f\n' | \
+ find "${work_dir}/package-infos" -mindepth 1 -maxdepth 1 -printf '%f\n' | \
sed '
s|\.[^.]\+$||
s|\.\([^.]\+\)\.\([^.]\+\)\.\([^.]\+\)$| \1 \2 \3|
@@ -247,9 +247,9 @@ delete_old_metadata() {
echo "${current_metadata}"
# package-states should stay
- find "${work_dir}/package-states" -maxdepth 1 -printf '%f\n' | \
+ find "${work_dir}/package-states" -mindepth 1 -maxdepth 1 -printf '%f\n' | \
sed '
- s|\.\([^.]\+\)\.\([^.]\+\)\(\.[^.]\+\)\.\([^.]\+\)$| \1 \2 \3|
+ s|\.\([^.]\+\)\.\([^.]\+\)\.\([^.]\+\)\.[^.]\+$| \1 \2 \3|
' | \
sort -u | \
sed 'p'
diff --git a/bin/db-update b/bin/db-update
index 992f183..9b3f92f 100755
--- a/bin/db-update
+++ b/bin/db-update
@@ -16,8 +16,6 @@
# TODO: handle deletion of parts of a split package
-# TODO: Who deletes state files of packages too early???
-
# shellcheck disable=SC2039
# shellcheck source=conf/default.conf
. "${0%/*}/../conf/default.conf"