aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rwxr-xr-xupdate.sh18
1 files changed, 10 insertions, 8 deletions
diff --git a/update.sh b/update.sh
index a1467fc..ea2519f 100755
--- a/update.sh
+++ b/update.sh
@@ -287,18 +287,20 @@ delete_obsolete_entries() {
if [ ! -e "$shared_path" ]; then
dump " missing source file: $shared_path" >&2
- if [ -z "${dry_run+x}" ]; then
- rm -f -- "$symlink_path"
- else
+ if [ ! -L "$symlink_path" ]; then
+ dump " not a symlink, so won't delete: $symlink_path"
+ elif [ -n "${dry_run+x}" ]; then
dump ' won'"'"'t delete an obsolete symlink, because it'"'"'s a dry run'
- fi
+ else
+ rm -f -- "$symlink_path"
- unset -v 'database[$entry]'
+ local symlink_dir
+ symlink_dir="$( dirname -- "$symlink_path" )"
- local symlink_dir
- symlink_dir="$( dirname -- "$symlink_path" )"
+ delete_obsolete_dirs "$symlink_var_dir" "$symlink_dir" || true
+ fi
- delete_obsolete_dirs "$symlink_var_dir" "$symlink_dir" || true
+ unset -v 'database[$entry]'
continue
fi