Commit 72071972 authored by PoroCYon's avatar PoroCYon
Browse files

make uninstall a little less overzealous

parent b3633690
......@@ -13,13 +13,13 @@ EOF
remove_empty_dir_rec() {
# ensure it stops somehwere - who knows / might be empty (somehow)
if [ "$1" = "/" ]; then
if [ "$1" = "$HOME/" ] || [ "$1" = "/" ]; then
return
fi
if ! file_exists_glob "$1/"*; then
echo "removing $1"
rm -rf "$1"
rm -rvf "$1"
else
return
fi
......@@ -47,10 +47,11 @@ main() {
LIN_="${LIN_%\"}"
LIN_="${LIN_#\"}"
rm -rf "$LIN_"
# if dir is empty, remove it
remove_empty_dir_rec "$(dirname "$LIN_")"
if echo "$SSPT_DEST_DIR" | grep -q -F "$LINE" && [ -f "$LIN_" ]; then
rm -rvf "$LIN_"
# if dir is empty, remove it
remove_empty_dir_rec "$(dirname "$LIN_")"
fi
done < "${SSPT_BIN_DB_DIR:?}/$ESCAPED_PKG"
# 2. remove from the db
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment