summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Allbery <rra@cpan.org>2022-01-17 14:20:44 -0800
committerRuss Allbery <rra@cpan.org>2022-01-17 14:20:44 -0800
commit53b9f3997c5885232e03ee75282bdba5f3665fc2 (patch)
treec87438906999b1375565dc46c1985cf96d041aeb
parentb6175e3bb0b1b36be013e0b83ea03f6fb6f09a73 (diff)
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.
-rw-r--r--Changes6
-rw-r--r--lib/App/DocKnot/Spin.pm5
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));