From 53b9f3997c5885232e03ee75282bdba5f3665fc2 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Mon, 17 Jan 2022 14:20:44 -0800 Subject: Follow symlinks for ordinary files in docknot spin Follow symlinks to ordinary files in docknot spin, just not directories. The Path::Iterator::Rule conversion in 6.01 broke copying of files referenced by symlink. --- Changes | 6 ++++++ lib/App/DocKnot/Spin.pm | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index 32766e2..d38287b 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,11 @@ Revision history for DocKnot +7.01 - Not Released + + - Follow symlinks to ordinary files in docknot spin, just not + directories. The Path::Iterator::Rule conversion in 6.01 broke copying + of files referenced by symlink. + 7.00 - 2022-01-17 - Various module APIs now take Path::Tiny objects instead of string diff --git a/lib/App/DocKnot/Spin.pm b/lib/App/DocKnot/Spin.pm index f7a5978..105b7f0 100644 --- a/lib/App/DocKnot/Spin.pm +++ b/lib/App/DocKnot/Spin.pm @@ -573,16 +573,17 @@ sub spin { #>>> # Process the input tree. + my %options = (follow_symlinks => 0, report_symlinks => 1); $rule = Path::Iterator::Rule->new(); $rule = $rule->skip($rule->new()->name($self->{excludes}->@*)); - $iter = $rule->iter("$input", { follow_symlinks => 0 }); + $iter = $rule->iter("$input", \%options); while (defined(my $file = $iter->())) { $self->_process_file(path($file)); } # Remove stray files from the output tree. if ($self->{delete}) { - my %options = (depthfirst => 1, follow_symlinks => 0); + $options{depthfirst} = 1; $iter = $rule->iter("$output", \%options); while (defined(my $file = $iter->())) { $self->_delete_files(path($file)); -- cgit v1.2.3