summaryrefslogtreecommitdiff
path: root/Porting/manicheck
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2021-09-22 07:04:48 +0000
committerNicholas Clark <nick@ccl4.org>2021-10-12 08:11:47 +0000
commitf73a32e0fd37de0a9c1965edfc1bda20d38e12d7 (patch)
tree92e60158190ad4e0c16798213a0d91615d32128e /Porting/manicheck
parent09cd3e1cbb58c83075231a9d80a523ef3631faee (diff)
downloadperl-f73a32e0fd37de0a9c1965edfc1bda20d38e12d7.tar.gz
In manicheck be explicit that the code is stripping './'
The regex had been written as /^../, which strictly was correct as the string passed would *always* start with './', but this wasn't clear. One had to stop and double check how File::Find::find() works, and what argument it was called with. And it's not exactly clear when the '.' in the regex text matches '.' and then '/', but the '/' in the regex is the delimiter. Given that the regex is being changed, move it later - previously the code was performing a substitution on the value of $File::Find::name before it knew that it needed it. (ie doing work for all directories.)
Diffstat (limited to 'Porting/manicheck')
-rw-r--r--Porting/manicheck5
1 files changed, 3 insertions, 2 deletions
diff --git a/Porting/manicheck b/Porting/manicheck
index 47bb2df381..c0d7548e6d 100644
--- a/Porting/manicheck
+++ b/Porting/manicheck
@@ -4,7 +4,7 @@
# a) files listed in MANIFEST which don't exist
# b) files which exist but which aren't in MANIFEST
-use strict;
+use v5.14;
use warnings;
use File::Find;
@@ -17,12 +17,13 @@ for (@files) {
my %files = map { $_ => 1 } @files;
find {
wanted => sub {
- my $x = $File::Find::name; $x =~ s/^..//;
return if -d;
return if $_ eq '.mailmap';
return if $_ eq '.gitignore';
return if $_ eq '.gitattributes';
return if $_ eq '.git_patch';
+
+ my $x = $File::Find::name =~ s!^\./!!r;
return if $x =~ /^\.git\b/;
return if $x =~ m{^\.github/};
print "$x\t\tnot in MANIFEST\n" if !$files{$x};