diff options
author | Russ Allbery <rra@cpan.org> | 2020-01-17 18:00:42 -0800 |
---|---|---|
committer | Russ Allbery <rra@cpan.org> | 2020-01-17 18:00:42 -0800 |
commit | 9fff12d47f86798d86f443b1286f70e9bcdf8da4 (patch) | |
tree | 2c58ce0f4e92a91e33d556dadf8b46d4ab0ffb8e /lib/App/DocKnot/Dist.pm | |
parent | 23ae630a721ff214053d007be099d9336af8ed7c (diff) |
Support ignore regexes for checking a distribution
docknot dist now supports a distribution/ignore metadata setting,
which contains a list of regular expressions of files to ignore when
checking a distribution tarball for completeness.
Diffstat (limited to 'lib/App/DocKnot/Dist.pm')
-rw-r--r-- | lib/App/DocKnot/Dist.pm | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/App/DocKnot/Dist.pm b/lib/App/DocKnot/Dist.pm index 6447065..85d81d0 100644 --- a/lib/App/DocKnot/Dist.pm +++ b/lib/App/DocKnot/Dist.pm @@ -100,13 +100,20 @@ sub _expected_dist_files { my ($self, $path) = @_; my @files; + # Supplemental ignore rules from the package configuration. + my @ignore; + if ($self->{config}{distribution}{ignore}) { + @ignore = map { qr{$_}xms } $self->{config}{distribution}{ignore}->@*; + } + # Find all files in the source directory, stripping its path from the file - # name and excluding (and pruning) anything matching @DIST_IGNORE. + # name and excluding (and pruning) anything matching @DIST_IGNORE or in + # the distribution/ignore key of the package configuration. my $wanted = sub { my $name = $File::Find::name; $name =~ s{ \A \Q$path\E / }{}xms; return if !$name; - if (any { $name =~ $_ } @DIST_IGNORE) { + if (any { $name =~ $_ } @DIST_IGNORE, @ignore) { $File::Find::prune = 1; return; } |