Skip to content

Commit 236f2ad

Browse files
committed
Add MANIFEST.SKIP file
This replaces the lists of files to skip in Porting/manicheck, t/porting/manifest.t and Porting/makerel 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 1aa8e6d commit 236f2ad

File tree

5 files changed

+17
-18
lines changed

5 files changed

+17
-18
lines changed

MANIFEST

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5128,6 +5128,7 @@ Makefile.SH A script that generates Makefile
51285128
malloc.c A version of malloc you might not want
51295129
malloc_ctl.h A version of malloc you might not want
51305130
MANIFEST This list of files
5131+
MANIFEST.SKIP Patterns for files not included in this file
51315132
mathoms.c A home for binary-compatible code artifacts
51325133
META.json Distribution meta-data in JSON
51335134
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/makerel

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,7 @@ cleanup($relroot, $reldir) if $opts{c};
8888

8989
print "Cross-checking the MANIFEST...\n";
9090
my ($missfile, $missentry) = fullcheck();
91-
@$missentry
92-
= grep {$_ !~ m!^\.(?:git|github|mailmap)! and $_ !~ m!(?:/|^)\.gitignore!} @$missentry;
93-
if (@$missfile ) {
91+
if (@$missfile) {
9492
warn "Can't make a release with MANIFEST files missing:\n";
9593
warn "\t".$_."\n" for (@$missfile);
9694
}

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)