Skip to content

Commit 2b7a8b2

Browse files
authored
Merge pull request #931 from metacpan/haarg/prevent-indexing-non-perl-releases
block indexing weird perl-like archives
2 parents 5cbc36a + eb1a97e commit 2b7a8b2

File tree

1 file changed

+43
-4
lines changed

1 file changed

+43
-4
lines changed

lib/MetaCPAN/Script/Release.pm

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,48 @@ has _bulk_size => (
8585
default => 10,
8686
);
8787

88+
my @skip_dists = (
89+
90+
# specific dists to skip. it's ugly to have all of these hard coded, but
91+
# it works for now
92+
qw(
93+
AEPAGE/perl5.00502Tk800.011-win32-586.zip
94+
ANDYD/perl5.002b1h.tar.gz
95+
BMIDD/perl5.004_02-AlphaNTPreComp.tar.gz
96+
BMIDD/perl5.00402-bindist04-msvcAlpha.tar.gz
97+
BMIDD/perl5.00402-bindist05-msvcAlpha.tar.gz
98+
GRABZIT/perl.2.3.0.zip
99+
GSAR/perl5.00401-bindist02-bc.tar.gz
100+
GSAR/perl5.00401-bindist-bc.tar.gz
101+
GSAR/perl5.00402-bindist03-bc.tar.gz
102+
GSAR/perl5.00402-bindist04-bc.tar.gz
103+
GSAR/perl5.00402-bindist04-bc.zip
104+
HOOO/perl-0.0017.tar.gz
105+
JBAKER/perl-5.005_02+apache1.3.3+modperl-1.16-bin-bindist1-i386-win32-vc5.zip
106+
KRISHPL/perl-5.6-info.tar.gz
107+
LMOLNAR/perl5.00402-bindist01-dos-djgpp.zip
108+
LMOLNAR/perl5.00503-bin-1-dos-djgpp.zip
109+
MSCHWERN/perl-1.0_15.tar.gz
110+
RCLAMP/perl-1.0_16.tar.gz
111+
SREZIC/perl-5.005-basicmods-bin-0-arm-linux.tar.gz
112+
SREZIC/perl-5.005-minimal-bin-0-arm-linux.tar.gz
113+
SREZIC/perl-5.005-minimal-bin-1-arm-linux.tar.gz
114+
SREZIC/perl-5.005-Tk-800.023-bin-0-arm-linux.tar.gz
115+
),
116+
117+
# ILYAZ has lots of old weird os2 files that don't fit as dists or perl releases
118+
qr{/ILYAZ/os2/[^/]+/perl_\w+\.zip\z},
119+
qr{/ILYAZ/os2/perl[^/]+\.zip\z},
120+
121+
# Strip off any files in a Perl6 folder
122+
# e.g. http://www.cpan.org/authors/id/J/JD/JDV/Perl6/
123+
# As here we are indexing perl5 only
124+
qr{/Perl6/},
125+
);
126+
127+
my ($SKIP_MATCH) = map qr/$_/, join '|',
128+
map +( ref $_ ? $_ : qr{/\Q$_\E\z} ), @skip_dists;
129+
88130
sub run {
89131
my $self = shift;
90132
my ( undef, @args ) = @{ $self->extra_argv };
@@ -138,10 +180,7 @@ sub run {
138180
}
139181
}
140182

141-
# Strip off any files in a Perl6 folder
142-
# e.g. http://www.cpan.org/authors/id/J/JD/JDV/Perl6/
143-
# As here we are indexing perl5 only
144-
@files = grep { $_ !~ m{/Perl6/} } @files;
183+
@files = grep $_ !~ $SKIP_MATCH, @files;
145184

146185
log_info { scalar @files, " archives found" } if ( @files > 1 );
147186

0 commit comments

Comments
 (0)