Following Schwern's suggestion, here is yet another try to get 
"#defaults" working in MANIFEST.SKIP to include the default
entries.  It comes with a test, the code itself and a minimal
documentation patch.

Thanks,
/Autrijus/

--- t/Manifest.t.orig   Sun Dec 14 11:36:04 2003
+++ t/Manifest.t        Sun Dec 14 11:58:17 2003
@@ -13,7 +13,7 @@
 
 use strict;
 
-use Test::More tests => 49;
+use Test::More tests => 50;
 use Cwd;
 
 use File::Spec;
@@ -191,6 +191,12 @@
 # This'll skip moretest/quux
 ($res, $warn) = catch_warning( \&skipcheck );
 like( $warn, qr{^Skipping moretest/quux$}i, 'got skipping warning again' );
+
+# Test that "#defaults" really pulls in the default skips
+add_file( 'MANIFEST.SKIP' => "#defaults\n" );
+add_file( 'pm_to_blib'    => '' );
+($res, $warn) = catch_warning( \&skipcheck );
+is( $warn, undef,   'MANIFEST.SKIP includes default entries with #defaults' );
 
 
 # There was a bug where entries in MANIFEST would be blotted out
--- lib/ExtUtils/Manifest.pm.orig       Fri Dec 12 08:48:05 2003
+++ lib/ExtUtils/Manifest.pm    Sun Dec 14 12:02:58 2003
@@ -348,14 +348,22 @@
     my @skip ;
     my $mfile = "$MANIFEST.SKIP";
     local(*M,$_);
-    open M, $mfile or open M, $DEFAULT_MSKIP or return sub {0};
-    while (<M>){
-       chomp;
-       next if /^#/;
-       next if /^\s*$/;
-       push @skip, _macify($_);
+    foreach my $M ($mfile, $DEFAULT_MSKIP) {
+       my $continue;
+       open M, $M or next;
+       while (<M>){
+           chomp;
+           $continue++ if /^#\s*defaults\s*$/;
+           next if /^#/;
+           next if /^\s*$/;
+           push @skip, _macify($_);
+       }
+       close M;
+       # Continue reading $DEFAULT_MSKIP only if "#defaults" is seen
+       last unless $continue;
     }
-    close M;
+    return sub {0} unless @skip;
+
     my $opts = $Is_VMS ? '(?i)' : '';
 
     # Make sure each entry is isolated in its own parentheses, in case
@@ -617,7 +625,13 @@
 
 If no MANIFEST.SKIP file is found, a default set of skips will be
 used, similar to the example above.  If you want nothing skipped,
-simply make an empty MANIFEST.SKIP file.
+simply make an empty MANIFEST.SKIP file.  If you want to add new
+entries in addition to the default set (instead of replacing it),
+use C<#defaults> like this:
+
+    #defaults
+    ^Build$
+    ^_build/
 
 
 =head2 EXPORT_OK

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to