aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2020-06-03 21:04:21 +0000
committermerakor <cem@ckyln.com>2020-06-03 21:04:21 +0000
commit9a03c9f925b520714476f6af74a37e40453867a5 (patch)
tree4f5c71e9b842794c887d595516cbd15da7dc15ab
parent34eae5364bfb038dd79600063ef8b49b66c1737a (diff)
downloadcpt-9a03c9f925b520714476f6af74a37e40453867a5.tar.gz
kiss: check for the manifest list before creating the 'dirs' file
FossilOrigin-Name: 7cc87731d210ba997f1a4938a1b5192642e9c5f69cd0793d2be728b708706de6
-rwxr-xr-xkiss4
1 files changed, 2 insertions, 2 deletions
diff --git a/kiss b/kiss
index 1d309e3..15ed5c8 100755
--- a/kiss
+++ b/kiss
@@ -1052,7 +1052,7 @@ pkg_remove() {
# purpose (such as baselayout).
manifest_list="$(set +f; pop "$sys_db/$1/manifest" from "$sys_db/"*/manifest)"
# shellcheck disable=2086
- grep -h '/$' $manifest_list | sort -ur > "$mak_dir/dirs"
+ [ $manifest_list ] && grep -h '/$' $manifest_list | sort -ur > "$mak_dir/dirs"
run_hook pre-remove "$1" "$sys_db/$1" root
@@ -1062,7 +1062,7 @@ pkg_remove() {
[ "${file##/etc/*}" ] || continue
if [ -d "$KISS_ROOT/$file" ]; then
- "$grep" -q "^$file\$" "$mak_dir/dirs" && continue
+ "$grep" -q "^$file\$" "$mak_dir/dirs" 2>/dev/null && continue
rmdir "$KISS_ROOT/$file" 2>/dev/null || continue
else
rm -f "$KISS_ROOT/$file"