Skip to content

Commit 9cf2952

Browse files
committed
Add MANIFEST.SKIP file
This replaces the lists of files to skip in Porting/manicheck and 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 034c827 commit 9cf2952

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
@@ -5104,6 +5104,7 @@ Makefile.SH A script that generates Makefile
51045104
malloc.c A version of malloc you might not want
51055105
malloc_ctl.h A version of malloc you might not want
51065106
MANIFEST This list of files
5107+
MANIFEST.SKIP Patterns for files not included in this file
51075108
mathoms.c A home for binary-compatible code artifacts
51085109
META.json Distribution meta-data in JSON
51095110
META.yml Distribution meta-data in YAML

MANIFEST.SKIP

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

Porting/manicheck

Lines changed: 7 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,12 @@ 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 $path =~ /^\.git\b/;
38+
return if $skip->($path);
39+
return if $files{$path};
4340
++$bonus;
44-
print "$x\t\tnot in MANIFEST\n";
41+
print "$path\t\tnot in MANIFEST\n";
4542
},
4643
}, ".";
4744

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)