support make bump V=patch
[p5sagit/Distar.git] / lib / Distar / helpers / check-manifest
CommitLineData
5baee32c 1#!/usr/bin/env perl
2use strict;
3use warnings FATAL => 'all';
4use ExtUtils::Manifest qw(filecheck maniread maniskip manicheck mkmanifest);
5
6{
7 local $ExtUtils::Manifest::Quiet = 1;
8 my $manimiss = ! -e 'MANIFEST';
9 if (-e 'MANIFEST') {
10 my @extra = manicheck;
11 if (@extra) {
12 die "Files in MANIFEST are missing from file system:\n"
13 . join('', map " $_\n", @extra);
14 }
15
16 my $read = maniread;
adbdb6d2 17 my @files = sort keys %$read;
18
19 my %lc;
20 for my $file (@files) {
adbdb6d2 21 if (my $other = $lc{lc $file}) {
22 die "ERROR: Multiple files only differing by case:\n\t$file\n\t$other\n";
23 }
24 $lc{lc $file} = $file;
25 }
5baee32c 26
89ed5872 27 my @missing = filecheck;
adbdb6d2 28
29 my $skip = maniskip;
30 my @remove = grep $skip->($_), @files;
5baee32c 31
32 exit 0
33 if !(@missing || @remove);
34 }
35}
36
37warn "Updating MANIFEST:\n";
38mkmanifest;
39warn "Go check it and retry.\n";
40exit 1;