From: Jesse Vincent Date: Tue, 6 Oct 2009 03:56:56 +0000 (-0400) Subject: podcheck.t now uses MANIFEST to choose which files it should check X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=69f6a9a1e215d426b05a8e22b39666a532bfffc3;p=p5sagit%2Fp5-mst-13.2.git podcheck.t now uses MANIFEST to choose which files it should check --- diff --git a/t/porting/podcheck.t b/t/porting/podcheck.t index 0df45a7..2567761 100644 --- a/t/porting/podcheck.t +++ b/t/porting/podcheck.t @@ -15,7 +15,6 @@ BEGIN { }; use Test::More; -use File::Find (); { package My::Pod::Checker; @@ -38,19 +37,22 @@ use File::Find (); }; } -my @files = @ARGV; -if (! @files) { - chdir '..' - or die "Couldn't chdir to ..: $!"; - chomp( my @d = ); - File::Find::find({ - no_chdir => 1, - wanted => sub { - return unless $File::Find::name =~ /(\.(pod|pm|pl))$/; - push @files, $File::Find::name; - }, - }, grep { m!/$! } @d ); - push @files, map { chomp; glob($_) } grep { ! m!/$! } @d; + +use strict; +use File::Spec; +chdir '..'; +my @files; +my $manifest = 'MANIFEST'; + +open my $m, '<', $manifest or die "Can't open '$manifest': $!"; + +while (<$m>) { + chomp; + next unless /\s/; # Ignore lines without whitespace (i.e., filename only) + my ($file, $separator) = /^(\S+)(\s+)/; + next if $file =~ /^cpan\//; + next unless ($file =~ /\.(?:pm|pod|pl)$/); + push @files, $file; @files = sort @files; # so we get consistent results };