@@ -404,6 +404,20 @@ a given filename should be skipped.
404
404
405
405
=cut
406
406
407
+ sub _process_skipline {
408
+ local $_ = shift;
409
+ chomp;
410
+ s/\r //;
411
+ $_ =~ qr{^\s * (? :(?: '([^\\ ']*(?:\\. [^\\ ']*)*)')|([^#\s ]\S *))?(?:(?:\s *)|(?:\s +(.* ?)\s * ))$};
412
+ # my $comment = $3;
413
+ my $filename = $2 ;
414
+ if ( defined ($1 ) ) {
415
+ $filename = $1 ;
416
+ $filename =~ s /\\ (['\\ ])/ $1 / g ;
417
+ }
418
+ $filename ;
419
+ }
420
+
407
421
# returns an anonymous sub that decides if an argument matches
408
422
sub maniskip {
409
423
my @skip ;
@@ -412,16 +426,14 @@ sub maniskip {
412
426
local (*M, $_ );
413
427
open M, " < $mfile " or open M, " < $DEFAULT_MSKIP " or return sub {0 };
414
428
while (<M>){
415
- chomp ;
416
- s /\r // ;
417
- $_ =~ qr { ^\s *(?:(?:'([^\\ ']*(?:\\ .[^\\ ']*)*)')|([^#\s ]\S *))?(?:(?:\s *)|(?:\s +(.*?)\s *))$} ;
418
- # my $comment = $3;
419
- my $filename = $2 ;
420
- if ( defined ($1 ) ) {
421
- $filename = $1 ;
422
- $filename =~ s /\\ (['\\ ])/ $1 / g ;
429
+ if (/ ^#!include_default\s *$ / ) {
430
+ if (my @default = _include_mskip_file()) {
431
+ warn " Debug: Including default MANIFEST.SKIP\n " if $Debug ;
432
+ push @skip , grep $_ , map _process_skipline($_ ), @default ;
433
+ }
434
+ next ;
423
435
}
424
- next if ( not defined ( $filename ) or not $filename );
436
+ next unless my $filename = _process_skipline( $_ );
425
437
push @skip , _macify($filename );
426
438
}
427
439
close M;
@@ -452,14 +464,6 @@ sub _check_mskip_directives {
452
464
return ;
453
465
}
454
466
while (<M>) {
455
- if (/ ^#!include_default\s *$ / ) {
456
- if (my @default = _include_mskip_file()) {
457
- push @lines , @default ;
458
- warn " Debug: Including default MANIFEST.SKIP\n " if $Debug ;
459
- $flag ++;
460
- }
461
- next ;
462
- }
463
467
if (/ ^#!include\s +(.*)\s *$ / ) {
464
468
my $external_file = $1 ;
465
469
if (my @external = _include_mskip_file($external_file )) {
@@ -809,11 +813,17 @@ files. At present two such directives are recognized.
809
813
810
814
=item #!include_default
811
815
812
- This inserts the contents of the default MANIFEST.SKIP file
816
+ This tells ExtUtils::Manifest to read the default F<MANIFEST.SKIP>
817
+ file and skip files accordingly, but I<not > to include it in the local
818
+ F<MANIFEST.SKIP> . This is intended to skip files according to a system
819
+ default, which can change over time without requiring further changes
820
+ to the distribution's F<MANIFEST.SKIP> .
813
821
814
822
=item #!include /Path/to/another/manifest.skip
815
823
816
- This inserts the contents of the specified external file
824
+ This inserts the contents of the specified external file in the local
825
+ F<MANIFEST.SKIP> . This is intended for authors to have a central
826
+ F<MANIFEST.SKIP> file, and to include it with their various distributions.
817
827
818
828
=back
819
829
0 commit comments