r52142 - in /branches/upstream/libtest-checkmanifest-perl/current: Changes MANIFEST MANIFEST.SKIP META.yml Makefile.PL Test.txt data/ data/Test2.dat lib/Test/CheckManifest.pm t/00_load.t t/01_selftest.t t/99_pod.t t/99_pod_coverage.t

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Thu Feb 4 15:57:47 UTC 2010


Author: jawnsy-guest
Date: Thu Feb  4 15:57:24 2010
New Revision: 52142

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=52142
Log:
[svn-upgrade] Integrating new upstream version, libtest-checkmanifest-perl (1.2)

Added:
    branches/upstream/libtest-checkmanifest-perl/current/MANIFEST.SKIP
    branches/upstream/libtest-checkmanifest-perl/current/Test.txt
    branches/upstream/libtest-checkmanifest-perl/current/data/
    branches/upstream/libtest-checkmanifest-perl/current/data/Test2.dat
Modified:
    branches/upstream/libtest-checkmanifest-perl/current/Changes
    branches/upstream/libtest-checkmanifest-perl/current/MANIFEST
    branches/upstream/libtest-checkmanifest-perl/current/META.yml
    branches/upstream/libtest-checkmanifest-perl/current/Makefile.PL
    branches/upstream/libtest-checkmanifest-perl/current/lib/Test/CheckManifest.pm
    branches/upstream/libtest-checkmanifest-perl/current/t/00_load.t
    branches/upstream/libtest-checkmanifest-perl/current/t/01_selftest.t
    branches/upstream/libtest-checkmanifest-perl/current/t/99_pod.t
    branches/upstream/libtest-checkmanifest-perl/current/t/99_pod_coverage.t

Modified: branches/upstream/libtest-checkmanifest-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-checkmanifest-perl/current/Changes?rev=52142&op=diff
==============================================================================
--- branches/upstream/libtest-checkmanifest-perl/current/Changes (original)
+++ branches/upstream/libtest-checkmanifest-perl/current/Changes Thu Feb  4 15:57:24 2010
@@ -1,35 +1,24 @@
 Revision history for Perl extension Test::CheckManifest.
 
-0.1   Fri Sep 29 09:18:09 2006
-      - original version; created by h2xs 1.23 with options
-        -XA -n Test::CheckManifest
-      + added tests for Pod coverage, Pod, Manifest
+1.2   Wed Feb 03 2010
+      + moved from SVN to Git (and adapted the filters in testfiles)
+      + added support for MANIFEST.SKIP
+      + small code improvements
 
-0.2  
-      - bugfix: some files excluded from test
+1.1   Sun Nov 22 13:18:12 2009
+      - CHECK as a label is not allowed in Perl > 5.11.x, so replace it
+      + switched license to Artistic 2.0
+      + bugfix in 01_selftest.t
 
-0.3   Wed Oct 18 21:36:32
-      - bugfix: CheckManifest works under Solaris now
+1.01  Sat Dec 29 00:28:13 2007
+      - fixes in test scripts
+        - require 5.006001
+        - allow more characters in path
+      + added license to Makefile.PL
+      + changed META.yml
 
-0.4   Thu Oct 19 10:47:27
-      - bugfix: handles different newlines (mac, win, *nix)
-      
-0.5   Sat Nov 18 18:00:00
-      - bugfix: T::CM now works under taint mode (http://rt.cpan.org/Public/Bug/Display.html?id=22927)
-      + added : ok_manifest accepts hashref where specific dirs can be excluded
-                from test
-
-0.6   Tue Nov 21 22:22:22 2006
-        Test scripts improved
-
-0.7   Thu Nov 23 12:58:54 2006
-      + added: "filter" to exclude files that match on specific regexp from test
-               (http://rt.cpan.org/Public/Bug/Display.html?id=23529)
-      + added: "bool" to combine "filter" and "exclude"
-      + added: boilerplate.t
-
-0.8   Fri Nov 24 09:17:10 2006
-      + added: T::CM now tests also on files that are not part of the distro but named in the MANIFEST
+1.0   Wed Dec 27 12:15:39 2006
+      - bugfix: ok_manifest excludes files created by Module::Build
 
 0.9   Mon Nov 27 09:35:26 2006
       - bugfix: ok_manifest files without blib (http://rt.cpan.org/Public/Bug/Display.html?id=23580)
@@ -40,12 +29,33 @@
                 (http://rt.cpan.org/Public/Bug/Display.html?id=23529)
       + added:  00_load.t
 
-1.0   Wed Dec 27 12:15:39 2006
-      - bugfix: ok_manifest excludes files created by Module::Build
+0.8   Fri Nov 24 09:17:10 2006
+      + added: T::CM now tests also on files that are not part of the distro but named in the MANIFEST
 
-1.01  Sat Dec 29 00:28:13 2007
-      - fixes in test scripts
-        - require 5.006001
-        - allow more characters in path
-      + added license to Makefile.PL
-      + changed META.yml
+0.7   Thu Nov 23 12:58:54 2006
+      + added: "filter" to exclude files that match on specific regexp from test
+               (http://rt.cpan.org/Public/Bug/Display.html?id=23529)
+      + added: "bool" to combine "filter" and "exclude"
+      + added: boilerplate.t
+
+0.6   Tue Nov 21 22:22:22 2006
+        Test scripts improved
+      
+0.5   Sat Nov 18 18:00:00
+      - bugfix: T::CM now works under taint mode (http://rt.cpan.org/Public/Bug/Display.html?id=22927)
+      + added : ok_manifest accepts hashref where specific dirs can be excluded
+                from test
+
+0.4   Thu Oct 19 10:47:27
+      - bugfix: handles different newlines (mac, win, *nix)
+
+0.3   Wed Oct 18 21:36:32
+      - bugfix: CheckManifest works under Solaris now
+
+0.2  
+      - bugfix: some files excluded from test
+
+0.1   Fri Sep 29 09:18:09 2006
+      - original version; created by h2xs 1.23 with options
+        -XA -n Test::CheckManifest
+      + added tests for Pod coverage, Pod, Manifest

Modified: branches/upstream/libtest-checkmanifest-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-checkmanifest-perl/current/MANIFEST?rev=52142&op=diff
==============================================================================
--- branches/upstream/libtest-checkmanifest-perl/current/MANIFEST (original)
+++ branches/upstream/libtest-checkmanifest-perl/current/MANIFEST Thu Feb  4 15:57:24 2010
@@ -2,10 +2,12 @@
 Makefile.PL
 MANIFEST
 README
+
 t/00_load.t
 t/01_selftest.t
 t/98_boilerplate.t
 t/99_pod.t
 t/99_pod_coverage.t
 lib/Test/CheckManifest.pm
-META.yml                                 Module meta-data (added by MakeMaker)
+
+META.yml

Added: branches/upstream/libtest-checkmanifest-perl/current/MANIFEST.SKIP
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-checkmanifest-perl/current/MANIFEST.SKIP?rev=52142&op=file
==============================================================================
--- branches/upstream/libtest-checkmanifest-perl/current/MANIFEST.SKIP (added)
+++ branches/upstream/libtest-checkmanifest-perl/current/MANIFEST.SKIP Thu Feb  4 15:57:24 2010
@@ -1,0 +1,3 @@
+^Test.txt$
+data/Test2.dat
+\.SKIP$

Modified: branches/upstream/libtest-checkmanifest-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-checkmanifest-perl/current/META.yml?rev=52142&op=diff
==============================================================================
--- branches/upstream/libtest-checkmanifest-perl/current/META.yml (original)
+++ branches/upstream/libtest-checkmanifest-perl/current/META.yml Thu Feb  4 15:57:24 2010
@@ -1,9 +1,10 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
-name:         Test-CheckManifest
-version:      1.01
-version_from: lib/Test/CheckManifest.pm
-installdirs:  site
+--- #YAML:1.0
+name:                Test-CheckManifest
+version:             1.1
+abstract:            Check if your Manifest matches your distro
+license:             artistic_2
+generated_by:        ExtUtils::MakeMaker version 6.31
+distribution_type:   module
 requires:
     Carp:                          0
     Cwd:                           0
@@ -11,6 +12,8 @@
     File::Find:                    0
     File::Spec:                    0
     Test::Builder:                 0
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.30_01
+meta-spec:
+    url:     http://module-build.sourceforge.net/META-spec-v1.2.html
+    version: 1.2
+author:
+    - Renee Baecker <module at renee-baecker.de>

Modified: branches/upstream/libtest-checkmanifest-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-checkmanifest-perl/current/Makefile.PL?rev=52142&op=diff
==============================================================================
--- branches/upstream/libtest-checkmanifest-perl/current/Makefile.PL (original)
+++ branches/upstream/libtest-checkmanifest-perl/current/Makefile.PL Thu Feb  4 15:57:24 2010
@@ -18,5 +18,5 @@
       (ABSTRACT_FROM  => 'lib/Test/CheckManifest.pm', # retrieve abstract from module
        AUTHOR         => 'Renee Baecker <module at renee-baecker.de>') : ()),
     ($ExtUtils::MakeMaker::VERSION >= 6.31 ?
-      (LICENSE        => 'perl') : ()),
+      (LICENSE        => 'artistic_2') : ()),
 );

Added: branches/upstream/libtest-checkmanifest-perl/current/Test.txt
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-checkmanifest-perl/current/Test.txt?rev=52142&op=file
==============================================================================
--- branches/upstream/libtest-checkmanifest-perl/current/Test.txt (added)
+++ branches/upstream/libtest-checkmanifest-perl/current/Test.txt Thu Feb  4 15:57:24 2010
@@ -1,0 +1,1 @@
+Test

Added: branches/upstream/libtest-checkmanifest-perl/current/data/Test2.dat
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-checkmanifest-perl/current/data/Test2.dat?rev=52142&op=file
==============================================================================
--- branches/upstream/libtest-checkmanifest-perl/current/data/Test2.dat (added)
+++ branches/upstream/libtest-checkmanifest-perl/current/data/Test2.dat Thu Feb  4 15:57:24 2010
@@ -1,0 +1,1 @@
+Test2

Modified: branches/upstream/libtest-checkmanifest-perl/current/lib/Test/CheckManifest.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-checkmanifest-perl/current/lib/Test/CheckManifest.pm?rev=52142&op=diff
==============================================================================
--- branches/upstream/libtest-checkmanifest-perl/current/lib/Test/CheckManifest.pm (original)
+++ branches/upstream/libtest-checkmanifest-perl/current/lib/Test/CheckManifest.pm Thu Feb  4 15:57:24 2010
@@ -10,7 +10,7 @@
 use Test::Builder;
 use File::Find;
 
-our $VERSION = '1.01';
+our $VERSION = '1.2';
 
 my $test      = Test::Builder->new();
 my $test_bool = 1;
@@ -44,9 +44,9 @@
     $msg = $hashref unless $is_hashref;
     
     my $bool     = 1;
-    my $dir      =
-    my $home     = Cwd::realpath(dirname(File::Spec->rel2abs($0)) . '/..');    
-    my $manifest = Cwd::realpath($home . '/MANIFEST');
+    my $home     = Cwd::realpath( dirname(File::Spec->rel2abs($0)) . '/..' );
+    my $manifest = Cwd::realpath( $home . '/MANIFEST' );
+    my $skip     = Cwd::realpath( $home . '/MANIFEST.SKIP' );
     
     my @missing_files = ();
     my @files_plus    = ();
@@ -59,9 +59,9 @@
                                'and' :
                                'or'; 
                    
-    push @$arref, @{$hashref->{exclude}} if($is_hashref and
-                                            exists $hashref->{exclude} and 
-                                            ref($hashref->{exclude}) eq 'ARRAY');
+    push @$arref, @{$hashref->{exclude}} 
+        if $is_hashref and exists $hashref->{exclude} and 
+            ref($hashref->{exclude}) eq 'ARRAY';
     
     for(@$arref){
         croak 'path in excluded array must be "absolute"' unless m!^/!;
@@ -72,12 +72,23 @@
     
     @$arref = grep { defined }@$arref;
     
-    unless( open(my $fh,'<',$manifest) ){
+    unless( open my $fh, '<', $manifest ){
         $bool = 0;
         $msg  = "can't open $manifest";
     }
     else{
-        my @files = grep{!/^\s*$/ and !/^META\.yml/}<$fh>;
+        { # extra block to use "last"
+        
+        my $files_in_skip = _read_skip( $skip, \$msg, \$bool );
+        last unless $files_in_skip;
+            
+        my @files;
+        while( my $fh_line = <$fh> ){
+            if( $fh_line =~ /^\s*([^\s#]\S*)/ and $fh_line !~ /^META\.yml/ ){
+                push @files, $1;
+            }
+        }
+        #my @files = grep{!/^\s*$/ and !/^META\.yml/}<$fh>;
         close $fh;
     
         chomp @files;
@@ -97,18 +108,31 @@
         @files_hash{@files} = ();
     
         find({no_chdir => 1,
-          wanted   => sub{ my $file         = $File::Find::name;
-                           my $is_excluded  = _is_excluded($file,$arref,$filter,$comb);
-                           push(@dir_files,Cwd::realpath($file)) if -f $file and !$is_excluded;
-                           $excluded{$file} = 1 if -f $file and $is_excluded}},$home);
-
-    
+            wanted   => sub{
+                my $file         = $File::Find::name;
+                my $is_excluded  = _is_excluded(
+                    $file,
+                    $arref,
+                    $filter,
+                    $comb,
+                    $files_in_skip,
+                    $home,
+                );
+                
+                push(@dir_files,Cwd::realpath($file)) if -f $file and !$is_excluded;
+                
+                $excluded{$file} = 1 if -f $file and $is_excluded
+            }
+        },$home);
+
+        #use Data::Dumper;
         #print STDERR ">>",++$counter,":",Dumper(\@files,\@dir_files);
-        CHECK: for my $file(@dir_files){
+        SFILE:
+        for my $file(@dir_files){
             for my $check(@files){
                 if($file eq $check){
                     delete $files_hash{$check};
-                    next CHECK;
+                    next SFILE;
                 }
             }
             push(@missing_files,$file);
@@ -116,8 +140,10 @@
         }
     
         delete $files_hash{$_} for keys %excluded;
-        @files_plus = keys %files_hash;
-        $bool = 0 if scalar @files_plus > 0;    
+        @files_plus = sort keys %files_hash;
+        $bool = 0 if scalar @files_plus > 0;
+        
+        } # close extra block
     }
     
     my $diag = 'The following files are not named in the MANIFEST file: '.
@@ -137,11 +163,19 @@
 }
 
 sub _is_excluded{
-    my ($file,$dirref,$filter,$bool) = @_;
+    my ($file,$dirref,$filter,$bool,$files_in_skip,$home) = @_;
     my @excluded_files = qw(pm_to_blib Makefile META.yml Build pod2htmd.tmp
                             pod2htmi.tmp Build.bat .cvsignore);
+
+    if ( $files_in_skip and 'ARRAY' eq ref $files_in_skip ) {
+        (my $local_file = $file) =~ s{\Q$home\E/?}{};
+        for my $rx ( @{$files_in_skip} ) {
+            my $regex = qr/$rx/;
+            return 1 if $local_file =~ $regex;
+        }
+    }
         
-    my @matches = grep{$file =~ /$_$/}@excluded_files;
+    my @matches = grep{ $file =~ /$_$/ }@excluded_files;
     
     if($bool eq 'or'){
         push @matches, $file if grep{ref($_) and ref($_) eq 'Regexp' and $file =~ /$_/}@$filter;
@@ -157,6 +191,39 @@
     return scalar @matches;
 }
 
+sub _read_skip {
+    my ($skip, $msg, $bool) = @_;
+    
+    my @files;
+    if( -e $skip and not open my $skip_fh, '<', $skip ) {
+        $$bool = 0;
+        $$msg  = "can't open $skip";
+        return;
+    }
+    else {
+        while ( my $line = <$skip_fh> ) {
+            chomp $line;
+            
+            next if $line =~ m{ \A \s* \# }x;
+            
+            my ($file,$comment);
+            
+            if (($file, $comment) = $line =~ /^'(\\[\\']|.+)+'\s*(.*)/) {
+                $file =~ s/\\([\\'])/$1/g;
+            }
+            else {
+                ($file, $comment) = $line =~ /^(\S+)\s*(.*)/;
+            }
+
+            next unless $file;
+            
+            push @files, $file;
+        }
+    }
+
+    return \@files;
+}
+
 1;
 __END__
 
@@ -240,6 +307,14 @@
 
 =back
 
+=head1 EXCLUDING FILES
+
+Beside C<filter> and C<exclude> there is another way to exclude files:
+C<MANIFEST.SKIP>. This is a file with filenames that should be excluded:
+
+  t/my_very_own.t
+  file_to.skip
+
 =head1 ACKNOWLEDGEMENT
 
 Great thanks to Christopher H. Laco, who did a lot of testing stuff for me and
@@ -251,11 +326,10 @@
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (C) 2006 by Renee Baecker
+Copyright (C) 2006 - 2009 by Renee Baecker
 
 This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself, either Perl version 5.8.6 or,
-at your option, any later version of Perl 5 you may have available.
+it under the same terms as Artistic License 2.0
 
 
 =cut

Modified: branches/upstream/libtest-checkmanifest-perl/current/t/00_load.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-checkmanifest-perl/current/t/00_load.t?rev=52142&op=diff
==============================================================================
--- branches/upstream/libtest-checkmanifest-perl/current/t/00_load.t (original)
+++ branches/upstream/libtest-checkmanifest-perl/current/t/00_load.t Thu Feb  4 15:57:24 2010
@@ -1,7 +1,7 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use Test::More tests => 1;
-
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use Test::More tests => 1;
+
 use_ok('Test::CheckManifest');

Modified: branches/upstream/libtest-checkmanifest-perl/current/t/01_selftest.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-checkmanifest-perl/current/t/01_selftest.t?rev=52142&op=diff
==============================================================================
--- branches/upstream/libtest-checkmanifest-perl/current/t/01_selftest.t (original)
+++ branches/upstream/libtest-checkmanifest-perl/current/t/01_selftest.t Thu Feb  4 15:57:24 2010
@@ -6,10 +6,8 @@
 use File::Basename;
 use Test::More;
 
-eval "use Test::CheckManifest tests => 10";
+eval "use Test::CheckManifest tests => 9";
 plan skip_all => "Test::CheckManifest required" if $@;
-
-ok_manifest();
 
 # create a directory and a file 
 my $home = dirname(File::Spec->rel2abs($0));
@@ -24,7 +22,7 @@
     die "Bad data in $home"; 
 }
 
-my $dir  = $home . '/.svn/';
+my $dir  = $home . '/.git/';
 my $dir2 = $home . '/test/';
 my ($file1,$file2,$file3) = ($dir.'test.txt', $home . '/test.svn', $dir2.'hallo.txt');
 
@@ -35,23 +33,23 @@
 open $fh ,'>',$file2 and close $fh;
 
 Test::CheckManifest::_not_ok_manifest('expected: Manifest not ok');
-ok_manifest({filter => [qr/\.svn/]},'Filter: \.svn');
-Test::CheckManifest::_not_ok_manifest({exclude => ['/t/.svn/']},'expected: Manifest not ok (Exclude /t/.svn/)');
+ok_manifest({filter => [qr/\.(?:svn|git)/]},'Filter: \.(?:svn|git)');
+Test::CheckManifest::_not_ok_manifest({exclude => ['/.git/']},'expected: Manifest not ok (Exclude /.git/)');
 
 mkdir $dir2;
 open $fh ,'>',$file3 and close $fh;
 Test::CheckManifest::_not_ok_manifest({filter => [qr/\.svn/]},'Filter: \.svn');
-Test::CheckManifest::_not_ok_manifest({exclude => ['/t/.svn/']},'expected: Manifest not ok (Exclude /t/.svn/) [2]');
-Test::CheckManifest::_not_ok_manifest({filter => [qr/\.svn/], exclude => ['/t/.svn/']},'expected: Manifest not ok (exclude OR filter)');
-Test::CheckManifest::_not_ok_manifest({filter  => [qr/\.svn/],
+Test::CheckManifest::_not_ok_manifest({exclude => ['/.git/']},'expected: Manifest not ok (Exclude /.git/) [2]');
+Test::CheckManifest::_not_ok_manifest({filter => [qr/\.git/], exclude => ['/.git/']},'expected: Manifest not ok (exclude OR filter)');
+Test::CheckManifest::_not_ok_manifest({filter  => [qr/\.git/],
                                        bool    => 'and',
                                        exclude => ['/t/test']}, 'filter AND exclude');
-ok_manifest({filter  => [qr/\.svn/],
+ok_manifest({filter  => [qr/\.git/],
              exclude => ['/t/test']}, 'filter OR exclude');
 
 unlink $file3;
 
-ok_manifest({filter => [qr/\.svn/]},'Filter \.svn');
+ok_manifest({filter => [qr/\.git/, qr/\.svn/ ]},'Filter \.git or \.svn');
 
 unlink $file2, $file1;
 rmdir  $dir;

Modified: branches/upstream/libtest-checkmanifest-perl/current/t/99_pod.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-checkmanifest-perl/current/t/99_pod.t?rev=52142&op=diff
==============================================================================
--- branches/upstream/libtest-checkmanifest-perl/current/t/99_pod.t (original)
+++ branches/upstream/libtest-checkmanifest-perl/current/t/99_pod.t Thu Feb  4 15:57:24 2010
@@ -1,10 +1,10 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use FindBin ();
-use Test::More;
-
-eval "use Test::Pod 1.00";
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use FindBin ();
+use Test::More;
+
+eval "use Test::Pod 1.00";
 plan skip_all => "Test::Pod 1.00 required" if $@;
 all_pod_files_ok();

Modified: branches/upstream/libtest-checkmanifest-perl/current/t/99_pod_coverage.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-checkmanifest-perl/current/t/99_pod_coverage.t?rev=52142&op=diff
==============================================================================
--- branches/upstream/libtest-checkmanifest-perl/current/t/99_pod_coverage.t (original)
+++ branches/upstream/libtest-checkmanifest-perl/current/t/99_pod_coverage.t Thu Feb  4 15:57:24 2010
@@ -1,9 +1,9 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use Test::More;
-
-eval "use Test::Pod::Coverage 1.08";
-plan skip_all => "Test::Pod::Coverage 1.08 required" if $@;
-all_pod_coverage_ok();
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use Test::More;
+
+eval "use Test::Pod::Coverage 1.08";
+plan skip_all => "Test::Pod::Coverage 1.08 required" if $@;
+all_pod_coverage_ok();




More information about the Pkg-perl-cvs-commits mailing list