unstow_link_node: rename $existing_source => $link_dest

The use of the word "source" to describe a link's destination is
confusing in the context of Stow for reasons explained in the manual.

So rename the $existing_source variable to $link_dest avoid this.
This commit is contained in:
Adam Spiers 2024-04-01 21:26:21 +01:00
parent 4525b9447d
commit 4272e7c4bb

View file

@ -828,19 +828,19 @@ sub unstow_link_node {
debug(4, 2, "Evaluate existing link: $target_subpath");
# Where is the link pointing?
my $existing_source = $self->read_a_link($target_subpath);
if (not $existing_source) {
my $link_dest = $self->read_a_link($target_subpath);
if (not $link_dest) {
error("Could not read link: $target_subpath");
}
if ($existing_source =~ m{\A/}) {
warn "Ignoring an absolute symlink: $target_subpath => $existing_source\n";
if ($link_dest =~ m{\A/}) {
warn "Ignoring an absolute symlink: $target_subpath => $link_dest\n";
return; # XXX #
}
# Does it point to a node under any stow directory?
my ($existing_path, $existing_stow_path, $existing_package) =
$self->find_stowed_path($target_subpath, $existing_source);
$self->find_stowed_path($target_subpath, $link_dest);
if (not $existing_path) {
if ($self->{compat}) {
# We're traversing the target tree not the package tree,
@ -852,7 +852,7 @@ sub unstow_link_node {
$self->conflict(
'unstow',
$package,
"existing target is not owned by stow: $target_subpath => $existing_source"
"existing target is not owned by stow: $target_subpath => $link_dest"
);
}
return;