From c0c01a6c61befd0036e5abaec220c57916f9b698 Mon Sep 17 00:00:00 2001 From: Adam Spiers Date: Wed, 11 Nov 2020 17:13:57 +0000 Subject: [PATCH] cleanup_invalid_links: improve handling of scheduled actions --- lib/Stow.pm.in | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/Stow.pm.in b/lib/Stow.pm.in index f7c4d60..2553546 100755 --- a/lib/Stow.pm.in +++ b/lib/Stow.pm.in @@ -1027,7 +1027,14 @@ sub cleanup_invalid_links { debug(4, 1, "Checking validity of link $node_path"); if (exists $self->{link_task_for}{$node_path}) { - die "huh? link_task_for $node_path"; + my $action = $self->{link_task_for}{$node_path}{action}; + if ($action ne 'remove') { + warn "Unexpected action $action scheduled for $node_path; skipping clean-up\n"; + } + else { + debug(4, 2, "$node_path scheduled for removal; skipping clean-up"); + } + next; } # Where is the link pointing?