# New Ticket Created by  Jürgen Bömmels 
# Please include the string:  [perl #16839]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=16839 >


Hi!

This MANIFEST things come up again and again. This time there are 5
missing files from 2 contributers. 

There really need some automatic testing on this. There is already a
manicheck.pl in tools/dev, but the user has to run in manually. Ok
stop whining, just do it. Here is a "make test" test which will
compare the MANIFEST with the CVS/Entries files, a diffrence between
these are reported as failure.
Uncommitted cvs add/remove are recognised, so a make test just before
the commit should complete with no error.
tarballs without CVS-directories will skip the CVS/Entries parsing.

The icu/ directory is skipped and ignored.

I named this test manifest.t in t/src but don't have a strong opinion
on this. Put it were you like, but remember to update the MANIFEST :-)



-- attachment  1 ------------------------------------------------------
url: http://rt.perl.org/rt2/attach/35994/29117/8c8c3b/manifest.t

-- attachment  2 ------------------------------------------------------
url: http://rt.perl.org/rt2/attach/35994/29118/7c7c8f/manifest.diff

#! perl -w

use Test::More tests => 4;

use File::Find qw(find);
use ExtUtils::Manifest;

my $ignore_re = qr,(?: ^ icu/ )
                  |(?:   \.cvsignore $ ),x;

ok (-e $ExtUtils::Manifest::MANIFEST, 'MANIFEST exists');

$ExtUtils::Manifest::Quiet = 1;
ok (!ExtUtils::Manifest::manicheck (), 'manicheck ()');

sub scan_cvs;
sub list_diff (\@\@);
sub read_manifest;

SKIP: {
  skip ('No CVS version', 1) unless -e 'CVS';

  local @cvs_entries;
  find { wanted => \&scan_cvs }, '.';

  @cvs_entries = grep { s,^./,, && !m/$ignore_re/ } @cvs_entries;

  my @manifest = sort keys %{ExtUtils::Manifest::maniread()};

  my ($cvs_miss, $mani_miss);

  ($cvs_miss, $mani_miss) = list_diff @cvs_entries, @manifest;

  local $" = "\n\t";

  ok (!@$cvs_miss, 'all files in MANIFEST are in CVS')
    or diag ("Missing files in CVS:\n\t@$cvs_miss");

  ok (!@$mani_miss, 'all files in CVS are in MANIFEST')
    or diag ("Missing files in Manifest:\n\t@$mani_miss");
}

sub scan_cvs {
  my $file = $_;

  if ( $file eq 'CVS') {
    local *CVS;

    open CVS, 'CVS/Entries';

    while (<CVS>) {
      chop; 
      next if m/^D/; # directories are will be further scanned

      my (undef, $entry, $rev) = split '/';
      push @cvs_entries, "$File::Find::dir/$entry" if $rev !~ m/^-/;
    }

    close CVS;

    $File::Find::prune = 1;
  }
}

sub list_diff (\@\@) {
  my ($a, $b) = @_;

  my %elem;
  grep { $elem{$_}++ } @$a;
  grep { $elem{$_}-- } @$b;

  return ( [ sort grep { $elem{$_} < 0 } keys %elem ],
           [ sort grep { $elem{$_} > 0 } keys %elem ] );
}

Index: MANIFEST
===================================================================
RCS file: /cvs/public/parrot/MANIFEST,v
retrieving revision 1.205
diff -u -r1.205 MANIFEST
--- MANIFEST	27 Aug 2002 05:31:39 -0000	1.205
+++ MANIFEST	29 Aug 2002 09:31:18 -0000
@@ -58,6 +58,8 @@
 config/gen/config_h/config_h.in
 config/gen/config_pm.pl
 config/gen/config_pm/Config_pm.in
+config/gen/libparrot_def.pl
+config/gen/libparrot_def/libparrot_def.in
 config/gen/makefiles.pl
 config/gen/makefiles/classes.in
 config/gen/makefiles/docs.in
@@ -67,6 +69,7 @@
 config/gen/makefiles/perl6.in
 config/gen/makefiles/root.in
 config/gen/makefiles/scheme.in
+config/gen/makefiles/imcc.in
 config/gen/platform.pl
 config/gen/platform/ansi.c
 config/gen/platform/ansi.h
@@ -377,6 +380,7 @@
 languages/perl6/examples/mandel.p6
 languages/perl6/examples/qsort.p6
 languages/perl6/mkdistro.sh
+languages/perl6/overview.pod
 languages/perl6/pconfig.pl
 languages/perl6/perl6
 languages/perl6/perl6re/Perl6RE.bnf
@@ -433,6 +437,7 @@
 languages/perl6/t/parser/speed_3.exp
 languages/perl6/t/parser/speed_3.pl
 languages/perl6/t/rx/basic.t
+languages/perl6/t/rx/call.t
 languages/perl6/t/rx/special.t
 languages/python/python.bnf
 languages/python/python.prd
@@ -584,6 +589,7 @@
 t/pmc/pmc.t
 t/pmc/sub.t
 t/src/basic.t
+t/src/manifest.t
 test_main.c
 tools/dev/check_source_standards.pl
 tools/dev/lib_deps.pl
Index: MANIFEST.SKIP
===================================================================
RCS file: /cvs/public/parrot/MANIFEST.SKIP,v
retrieving revision 1.5
diff -u -r1.5 MANIFEST.SKIP
--- MANIFEST.SKIP	12 Jun 2002 22:12:15 -0000	1.5
+++ MANIFEST.SKIP	29 Aug 2002 09:31:18 -0000
@@ -19,6 +19,7 @@
 
 ^core_ops\.c$
 ^core_ops_prederef\.c$
+^core_ops_cg\.c$
 
 ^lib/Parrot/Jit\.pm$
 ^lib/Parrot/PMC\.pm$
@@ -33,4 +34,9 @@
 
 ^parrot$
 ^pdump$
+^pdb$
 ^blib/
+
+^icu/
+
+^t/.*/.*_\d+\.

Reply via email to