Skip to content

Commit ad8f2a2

Browse files
committed
Add MANIFEST.SKIP file
This replaces the lists of files to skip in Porting/manicheck, t/porting/manifest.t with a centralized and standardized MANIFEST.SKIP file. This would also allow us to add a make manifest target, but I left that for a follow-up PR.
1 parent 508aafd commit ad8f2a2

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

MANIFEST

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5132,6 +5132,7 @@ Makefile.SH A script that generates Makefile
51325132
malloc.c A version of malloc you might not want
51335133
malloc_ctl.h A version of malloc you might not want
51345134
MANIFEST This list of files
5135+
MANIFEST.SKIP Patterns for files not included in this file
51355136
mathoms.c A home for binary-compatible code artifacts
51365137
META.json Distribution meta-data in JSON
51375138
META.yml Distribution meta-data in YAML

MANIFEST.SKIP

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
\.mailmap
2+
\.gitignore
3+
\.gitattributes
4+
\.git_patch
5+
^\.git\b
6+
^\.github/

Porting/manicheck

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use v5.14;
88
use warnings;
99
use File::Find;
1010
use Getopt::Long;
11+
use ExtUtils::Manifest 'maniskip';
1112
use constant SKIP => 125;
1213

1314
my $exitstatus;
@@ -17,6 +18,7 @@ GetOptions('exitstatus!', \$exitstatus)
1718
my %files;
1819
my $missing = 0;
1920
my $bonus = 0;
21+
my $skip = maniskip;
2022

2123
open my $fh, '<', 'MANIFEST' or die "Can't read MANIFEST: $!\n";
2224
for my $line (<$fh>) {
@@ -31,17 +33,11 @@ close $fh;
3133
find {
3234
wanted => sub {
3335
return if -d;
34-
return if $_ eq '.mailmap';
35-
return if $_ eq '.gitignore';
36-
return if $_ eq '.gitattributes';
37-
return if $_ eq '.git_patch';
38-
39-
my $x = $File::Find::name =~ s!^\./!!r;
40-
return if $x =~ /^\.git\b/;
41-
return if $x =~ m{^\.github/};
42-
return if $files{$x};
36+
my $path = $File::Find::name =~ s!^\./!!r;
37+
return if $skip->($path);
38+
return if $files{$path};
4339
++$bonus;
44-
print "$x\t\tnot in MANIFEST\n";
40+
print "$path\t\tnot in MANIFEST\n";
4541
},
4642
}, ".";
4743

t/porting/manifest.t

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
# correct the problem.
2626

2727
use Config;
28+
use ExtUtils::Manifest 'maniskip';
2829
BEGIN {
2930
@INC = '..' if -f '../TestInit.pm';
3031
}
@@ -85,14 +86,11 @@ SKIP: {
8586

8687
SKIP: {
8788
find_git_or_skip(6);
89+
my $skip = maniskip;
8890
my %seen; # De-dup ls-files output (can appear more than once)
8991
my @repo= grep {
9092
chomp();
91-
!m{\.git_patch$} &&
92-
!m{\.gitattributes$} &&
93-
!m{\.gitignore$} &&
94-
!m{\.mailmap$} &&
95-
!m{^\.github/} &&
93+
!$skip->($_) &&
9694
-e $_ &&
9795
!$seen{$_}++
9896
} `git ls-files`;

0 commit comments

Comments
 (0)