I can setup the CVS repository to notify the user after a checkin where
something has gone awry. But, I'm low on tuits, so I need to farm out
a little of the work.
I need a script that meets the following specs:
Input (via command line)
1) file representing MANIFEST
2) file representing MANIFEST.SKIP
3) file representing list of all files found
Output (via stdout)
error message if manifest check fails
Restrictions:
The script cannot access any other files/filesystems/directory
listings besides the data in the files provided on the command
line.
I think the easiest to implement this is by subclassing
ExtUtils::Manifest, and overriding manifiles() and maybe one or two
other subroutines.
-R (CVS TimeLord)
JEff
t/src/manifest.t calls ExtUtils::Manifest, which does a recursive find
over the directory tree, and therefore violates one of the constraints:
> On Monday, September 29, 2003, at 01:36 PM, Robert Spier wrote:
> > Restrictions:
> > The script cannot access any other files/filesystems/directory
> > listings besides the data in the files provided on the command
> > line.
Nicholas Clark
I assume you can probably yank the Mac and VMS stuff... but left it in
anyway.
Garrett
#!/usr/bin/perl
use ExtUtils::Manifest;
die "expected 3 args" unless 3 == @ARGV;
-f or die "file not found: $_" for @ARGV;
my $found = {};
my $Is_MacOS = $^O eq 'MacOS';
my $Is_VMS = $^O eq 'VMS';
require VMS::Filespec if $Is_VMS;
$ExtUtils::Manifest::MANIFEST = shift;
my $read = ExtUtils::Manifest::maniread() || {};
$ExtUtils::Manifest::DEFAULT_MSKIP = shift;
my $skip = ExtUtils::Manifest::_maniskip();
open IN, shift;
/^(.*)$/ and $found->{$1}++ while (<IN>);
close IN;
# _check_manifest
foreach my $file (sort keys %$found){
next if $skip->($file);
unless ( exists $read->{$file} ) {
my $canon = $Is_MacOS
? "\t".ExtUtils::Manifest::_unmacify($file)
: '';
warn "Not in $ExtUtils::Manifest::MANIFEST: $file$canon\n";
}
}
# _check_files
foreach my $file (sort keys %$read) {
warn "No such file: $file\n" unless exists $found->{$file}
}
1;
__END__
--
Garrett Goebel
IS Development Specialist
ScriptPro Direct: 913.403.5261
5828 Reeds Road Main: 913.384.1008
Mission, KS 66202 Fax: 913.384.2180
www.scriptpro.com garrett at scriptpro dot com
Starting now, if anyone does something to make the MANIFEST unhappy,
it will print out a message at the bottom of the commit log.
You'll see things like this:
manicheck: Not in MANIFEST: somefile1
manicheck: File not found: somefile2
Enjoy!
-R (CVS Timelord)
> Robert Spier wrote:
> > I need a script that meets the following specs: