From f98c2aace96dc43da9a7523635b9916dc4e01516 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 31 Oct 2017 13:27:42 +0100 Subject: bin/common-functions: delete_old_metadata: bugfix (and solve TODO) --- bin/common-functions | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bin/common-functions') 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' -- cgit v1.2.3-54-g00ecf