/
manicheck.pl
executable file
·75 lines (55 loc) · 1.77 KB
/
manicheck.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#! perl
################################################################################
# Copyright (C) 2001-2010, Parrot Foundation.
################################################################################
=head1 NAME
tools/dev/manicheck.pl - Check the MANIFEST file
=head1 SYNOPSIS
% perl tools/dev/manicheck.pl
=head1 DESCRIPTION
Check the contents of the F<MANIFEST> file against the files present in
this directory tree, accounting for .git dirs. Prints out the
number of I<missing>, I<expected> and I<extra> files, and
then any extra files are listed.
Files that match the patterns in MANIFEST.SKIP are not reported as extra
files.
=cut
################################################################################
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../../lib";
use ExtUtils::Manifest;
$ExtUtils::Manifest::Quiet = 1;
my $manifest = ExtUtils::Manifest::maniread();
my $file_list = ExtUtils::Manifest::manifind();
my @missing = ExtUtils::Manifest::manicheck();
my @extra = ExtUtils::Manifest::filecheck();
# my @ignored = ExtUtils::Manifest::skipcheck();
# strip '~' backup files from the extra list
@extra = grep !m/(~|\.swp)$/, @extra;
printf "Found %d distinct files among MANIFEST and directory contents.\n\n",
scalar( keys %{$file_list} );
printf " %5d missing\n", scalar @missing;
printf " %5d extra\n", scalar @extra;
if (@missing) {
print "\n";
print "Missing files:\n";
foreach (@missing) {
print " $_\n";
}
}
if (@extra) {
print "\n";
print "Extra files:\n";
foreach (@extra) {
print " $_\n";
}
}
exit scalar(@missing) or scalar(@extra) ? 1 : 0;
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4: